Where is awekas.zip? is it in ~/weewx-data ? Previously you named your 
extension package AWEKAS.zip not awekas.zip, did you change names or are 
you still using AWEKAS.zip? If so you need weectl extension install 
AWEKAS.zip not weectl extension install awekas.zip.

Gary
On Thursday 29 February 2024 at 19:00:48 UTC+10 [email protected] wrote:

> Yesss ! Thank's Gary!!! We progress... :-)))
>
> BUT... :-(((
> Now with *from weecfg.extension import ExtensionInstaller or from setup 
> import ExtensionInstaller the error* in install.py, the error is :
>
>  (weewx-venv) remy@remy-virtual-machine:~/weewx-data$ weectl extension 
> install awekas.zip
> Using configuration file /home/remy/weewx-data/weewx.conf
> Install extension 'awekas.zip' (y/n)? y
>
> Traceback (most recent call last):
>   File "/home/remy/weewx-venv/bin/weectl", line 8, in <module>
>     sys.exit(main())
>   File "/home/remy/weewx-venv/lib/python3.8/site-packages/weectl.py", line 
> 66, in main
>     namespace.func(namespace)
>   File 
> "/home/remy/weewx-venv/lib/python3.8/site-packages/weectllib/__init__.py", 
> line 121, in dispatch
>     namespace.action_func(config_dict, namespace)
>   File 
> "/home/remy/weewx-venv/lib/python3.8/site-packages/weectllib/extension_cmd.py",
>  
> line 116, in install_extension
>     ext.install_extension(namespace.source, no_confirm=namespace.yes)
>   File 
> "/home/remy/weewx-venv/lib/python3.8/site-packages/weecfg/extension.py", 
> line 143, in install_extension
>     raise InstallError(f"Unrecognized type for {extension_path}")
> weecfg.extension.InstallError: Unrecognized type for awekas.zip
>
> Le jeudi 29 février 2024 à 09:35:50 UTC+1, gjr80 a écrit :
>
>> On Thursday 29 February 2024 at 17:50:33 UTC+10 [email protected] 
>> wrote:
>>
>> *with* :  unzip -l AWEKAS.zip 
>> *we have* :
>> (weewx-venv) remy@remy-virtual-machine:~/weewx-data$ unzip -l AWEKAS.zip
>> Archive:  AWEKAS.zip
>>   Length      Date    Time    Name
>> ---------  ---------- -----   ----
>>         0  2024-02-29 08:42   AWEKAS/
>>       565  2024-02-29 08:42   AWEKAS/install.py
>>     35149  2024-02-26 10:33   AWEKAS/LICENSE.txt
>>     56528  2024-02-26 10:33   AWEKAS*/awekaswx.py*
>> ---------                     -------
>>     92242                     4 files
>>
>>
>> And there is your problem, the structure of your extension 
>> package/archive does not agree with the instructions you have given to the 
>> installer. The line:
>>
>> files=[('bin/user', ['bin/user/awekaswx.py'])],
>>
>> in your installer is telling the extension installer to copy the file 
>> awekaswx.py from the bin/user directory in your extension 
>> package/archive to the WeeWX bin/user directory. The problem is 
>> bin/user/awekaswx.py does not exist in your archive, you have awekaswx.py 
>> in the main directory (AWEKAS) of your archive.
>>
>> Take for example the Ecowitt gateway driver extension package, its 
>> structure is:
>>
>> gary@cockatoo1:~ $ unzip -l ./gw1000.zip
>> Archive:  ./gw1000.zip
>>
>>   Length      Date    Time    Name
>> ---------  ---------- -----   ----
>>         0  2024-02-21 19:39   gw1000/bin/
>>         0  2024-02-21 19:39   gw1000/bin/user/
>>      6148  2024-02-11 20:14   gw1000/bin/user/.DS_Store
>>    390698  2024-02-21 19:39   gw1000/bin/user/gw1000.py
>>      8355  2024-02-21 19:39   gw1000/changelog
>>     11114  2024-02-21 19:39   gw1000/install.py
>>     11346  2024-02-21 19:39   gw1000/readme.txt
>> ---------                     -------
>>
>> The extension installer has the same line:
>>
>> files=[('bin/user', ['bin/user/gw1000.py'])],
>>  
>> (well the same but of course a different file name). Note 
>> bin/user/gw1000.py exists in the extension package/extension. 
>>
>>  To fix you have two choices, change the files = line in your extension 
>> installer or change the structure of your extension package/archive. I 
>> favour the latter, it keeps the structure of the extension package more 
>> akin to the WeeWX file structure and avoids the 'put everything in one 
>> directory' approach. Your choice.
>>
>> Gary
>>
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/f3996539-b321-4993-a02e-2c1b0c47b161n%40googlegroups.com.

Reply via email to