Add your user (typically pi) to group weewx so it has permission to write 
the config files in /etc/weewx which is group weewx.

   - sudo usermod -aG weewx pi
   - then log out as user pi, and log back in to make it take effect
   - then try the extension install which should work fine 'without' sudo

(I had a spare pi to test on and the above worked for me just now)

Once the initial weewx package is installed you shouldn't need to use sudo 
at all, nor should you.  Weewx v5 does not run as root.  A dpkg 
installation runs as user 'weewx' group 'weewx'.  You can check your group 
membership via the 'groups' command which should return output that looks 
something like:

pi@raspberrypi:~ $ groups
pi adm dialout cdrom sudo audio video plugdev games users input render 
netdev lpadmin weewx gpio i2c spi

On Thursday, August 14, 2025 at 10:06:36 AM UTC-7 Judge Richter wrote:

> now i have an other error
>
>
> *weectl extension install -y       
>  https://gitlab.com/wjcarpenter/bme280wx/-/archive/master/bme280wx-master.zip 
> <https://gitlab.com/wjcarpenter/bme280wx/-/archive/master/bme280wx-master.zip>Error
>  
> parsing config file: [Errno 13] Permission denied: '/etc/weewx/weewx.conf'*
>
>
> *Traceback (most recent call last):*
>
>
>
>
>
>
>
>
>
>
>
> *  File "/usr/share/weewx/weeutil/startup.py", line 86, in start_app    
> config_path, config_dict = weecfg.read_config(config_option, [config_arg])  
>                             
>  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  File 
> "/usr/share/weewx/weecfg/__init__.py", line 150, in read_config    
> config_dict = configobj.ConfigObj(config_path,                  
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  File 
> "/usr/lib/python3/dist-packages/configobj/__init__.py", line 1229, in 
> __init__    self._load(infile, configspec)  File 
> "/usr/lib/python3/dist-packages/configobj/__init__.py", line 1236, in 
> _load    with open(infile, 'rb') as h:        
>  ^^^^^^^^^^^^^^^^^^PermissionError: [Errno 13] Permission denied: 
> '/etc/weewx/weewx.conf'*
>
> and when i run weectl with sudo
>
>
>
> *Using configuration file /etc/weewx/weewx.confTraceback (most recent call 
> last):*
>
>
>
>
>
>
>
>
>
>
>
> *  File "/usr/share/weewx/weectl.py", line 75, in <module>    main()  File 
> "/usr/share/weewx/weectl.py", line 67, in main    
> namespace.func(namespace)  File "/usr/share/weewx/weectllib/__init__.py", 
> line 80, in dispatch    config_path, config_dict, log = 
> weeutil.startup.start_app('weectl',                                    
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  File 
> "/usr/share/weewx/weeutil/startup.py", line 111, in start_app    
> weewx_root, user_module = initialize(config_dict)                          
>     ^^^^^^^^^^^^^^^^^^^^^^^  File "/usr/share/weewx/weeutil/startup.py", 
> line 76, in initialize    importlib.import_module('user.extensions')*
>
>
>
>
>
>
>
>
>
>
> *  File "/usr/lib/python3.11/importlib/__init__.py", line 126, in 
> import_module    return _bootstrap._gcd_import(name[level:], package, 
> level)           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  File 
> "<frozen importlib._bootstrap>", line 1206, in _gcd_import  File "<frozen 
> importlib._bootstrap>", line 1178, in _find_and_load  File "<frozen 
> importlib._bootstrap>", line 1149, in _find_and_load_unlocked  File 
> "<frozen importlib._bootstrap>", line 690, in _load_unlocked  File "<frozen 
> importlib._bootstrap_external>", line 940, in exec_module  File "<frozen 
> importlib._bootstrap>", line 241, in _call_with_frames_removed*
>
>
>
>
>
> *  File "/etc/weewx/bin/user/extensions.py", line 18, in <module>    
> locale.setlocale(locale.LC_ALL, '')  File "/usr/lib/python3.11/locale.py", 
> line 626, in setlocale    return _setlocale(category, locale)          
>  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^locale.Error: unsupported locale setting*
>
> I have installed weewx using apt 
> https://weewx.com/docs/5.1/quickstarts/debian/#install
> vince schrieb am Donnerstag, 14. August 2025 um 18:12:24 UTC+2:
>
>> sudo apt install python3-bme280
>>
>> On Thursday, August 14, 2025 at 8:21:38 AM UTC-7 Judge Richter wrote:
>>
>>> Installation of bme280 works but the weewx start failed:
>>>
>>> I can read the data from bme280 manually with a python script.
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> *Using configuration file /etc/weewx/weewx.confExtension Name    Version 
>>>   Descriptionbme280wx          1.0       Add bme280 sensor readings to loop 
>>> packet datapi@weather:~$ sudo nano /etc/weewx/weewx.confpi@weather:~$ 
>>> weewxd Using configuration file /etc/weewx/weewx.confTraceback (most recent 
>>> call last):  File "/usr/share/weewx/weewxd.py", line 226, in <module>    
>>> main()  File "/usr/share/weewx/weewxd.py", line 121, in main    engine = 
>>> weewx.engine.StdEngine(config_dict)            
>>>  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  File 
>>> "/usr/share/weewx/weewx/engine.py", line 89, in __init__    
>>> self.loadServices(config_dict)  File "/usr/share/weewx/weewx/engine.py", 
>>> line 157, in loadServices    obj = weeutil.weeutil.get_object(svc)(self, 
>>> config_dict)          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  File 
>>> "/usr/share/weewx/weeutil/weeutil.py", line 1404, in get_object    module = 
>>> importlib.import_module(module_name)            
>>>  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  File 
>>> "/usr/lib/python3.11/importlib/__init__.py", line 126, in import_module    
>>> return _bootstrap._gcd_import(name[level:], package, level)          
>>>  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  File "<frozen 
>>> importlib._bootstrap>", line 1206, in _gcd_import  File "<frozen 
>>> importlib._bootstrap>", line 1178, in _find_and_load  File "<frozen 
>>> importlib._bootstrap>", line 1149, in _find_and_load_unlocked  File 
>>> "<frozen importlib._bootstrap>", line 690, in _load_unlocked  File "<frozen 
>>> importlib._bootstrap_external>", line 940, in exec_module  File "<frozen 
>>> importlib._bootstrap>", line 241, in _call_with_frames_removed  File 
>>> "/etc/weewx/bin/user/bme280wx.py", line 6, in <module>    import 
>>> bme280ModuleNotFoundError: No module named 'bme280'*
>>>
>>

-- 
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 visit 
https://groups.google.com/d/msgid/weewx-user/b9b6302c-a81e-4ec5-91e7-e87248deb291n%40googlegroups.com.

Reply via email to