using 'weectl database' → error "No module named 'user'"

137 views
Skip to first unread message

Graham Eddy

unread,
Jan 8, 2024, 7:31:55 AM1/8/24
to WeeWX User
running weewx 5.0.0b16 in production quite happily for weeks - it works fine.
i needed to delete a bad barometer reading from station called ‘vantage’, so i stopped unit weewx@vantage, set the value to None, then tried to rebuild the daily database → following error:

(venv) weewx@wx:~$ weectl database rebuild-daily --config=/home/weewx/vantage/weewx.conf

The configuration file /home/weewx/vantage/weewx.conf will be used.

Traceback (most recent call last):

  File "/home/weewx/venv/bin/weectl", line 8, in <module>

    sys.exit(main())

             ^^^^^^

  File "/home/weewx/venv/lib/python3.11/site-packages/weectl.py", line 69, in main

    namespace.func(namespace)

  File "/home/weewx/venv/lib/python3.11/site-packages/weectllib/database_cmd.py", line 307, in rebuild_daily

    weectllib.database_actions.rebuild_daily(namespace.config,

  File "/home/weewx/venv/lib/python3.11/site-packages/weectllib/database_actions.py", line 91, in rebuild_daily

    config_path, config_dict, database_name = weectllib.prepare(config_path, db_binding, dry_run)

                                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/home/weewx/venv/lib/python3.11/site-packages/weectllib/__init__.py", line 86, in prepare

    manager_dict = weewx.manager.get_manager_dict_from_config(config_dict,

                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/home/weewx/venv/lib/python3.11/site-packages/weewx/manager.py", line 886, in get_manager_dict_from_config

    manager_dict['schema'] = weeutil.weeutil.get_object(schema_name)

                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/home/weewx/venv/lib/python3.11/site-packages/weeutil/weeutil.py", line 1398, 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 1128, in _find_and_load_unlocked

  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed

  File "<frozen importlib._bootstrap>", line 1206, in _gcd_import

  File "<frozen importlib._bootstrap>", line 1178, in _find_and_load

  File "<frozen importlib._bootstrap>", line 1128, in _find_and_load_unlocked

  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed

  File "<frozen importlib._bootstrap>", line 1206, in _gcd_import

  File "<frozen importlib._bootstrap>", line 1178, in _find_and_load

  File "<frozen importlib._bootstrap>", line 1142, in _find_and_load_unlocked

ModuleNotFoundError: No module named 'user'


didn’t find this error searching in forum archive. is it a known error? is it fixed in later release?
⊣GE⊢

Tom Keffer

unread,
Jan 8, 2024, 10:37:00 AM1/8/24
to weewx...@googlegroups.com
Do you have a value for WEEWX_ROOT in the configuration file /home/weewx/vantage/weewx.conf?

Also, what is in /home/weewx/bin?

I'm reluctant to put too much energy in debugging b16, because a lot of how WEEWX_ROOT is handled has changed since then. If you're still having problems, upgrade to the current rc3.

-tk

--
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 weewx-user+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/2A27FC4D-93D4-445A-B259-92E910BAD8C5%40geddy.au.

Graham Eddy

unread,
Jan 8, 2024, 10:40:13 PM1/8/24
to WeeWX User
just a standard V5 pip installation that otherwise works fine

(venv) graham@wx:/home/weewx$ ls bin

ls: cannot access 'bin': No such file or directory

(venv) graham@wx:/home/weewx$ ls venv/bin

activate       cheetah          pasteurize  pyserial-miniterm  python3.11

activate.csh   cheetah-analyze  pip         pyserial-ports     weectl

activate.fish  cheetah-compile  pip3        python             weewxd

Activate.ps1   futurize         pip3.11     python3

(venv) graham@wx:/home/weewx$ ls vantage/bin

user

(venv) graham@wx:/home/weewx$ grep WEEWX_ROOT vantage/weewx.conf

WEEWX_ROOT = /home/weewx/vantage

    # Where the skins reside, relative to WEEWX_ROOT

    # Where the generated reports should go, relative to WEEWX_ROOT

        SQLITE_ROOT = %(WEEWX_ROOT)s/archive


you should put *no* effort into debugging b16, that’s what the release candidates are for.
i just wanted to know if this weectl error was known so i could fix my data now; it will wait until i’ve updated to release or release candidate.
cheers
⊣GE⊢

vince

unread,
Jan 8, 2024, 11:21:44 PM1/8/24
to weewx-user
Couple things. You need to source your venv/bin/activate to activate your venv before running weectl. And is your weewx data all within /home/weewx/vantage ?

Graham Eddy

unread,
Jan 9, 2024, 12:33:32 AM1/9/24
to WeeWX User
reasonable questions: yes to both, the ‘(venv)’ in the prompt is the clue to the first. i showed content of ~weewx/bin because i was asked for it; i knew it did not exist, and what was really being asked was for ~weewx/{venv}/bin and ~weewx/{station}/bin, so i showed those as well

actually running weewx using ~weewx/{station}/weew.conf via systemd is fine, and the CLI tools work fine provided i indicate —config=/home/weewx/{station}/weewx.conf (except ‘weectl database rebuild-daily —config=/home/weewx/{station}/weewx.conf’ does not work) - it’s not my config at fault, it is something in the rebuild-daily that barfed on using non-default station name. but debugging efforts will go to the release or release candidate not this beta, when i migrate.
cheers
⊣GE⊢
Reply all
Reply to author
Forward
0 new messages