column create/rename error "ModuleNotFoundError: No module named 'user'"

148 views
Skip to first unread message

neutrino

unread,
Dec 29, 2023, 8:27:02 AM12/29/23
to weewx-user
Hello everyone,
I try to modify my existing database after upgrading to v5.
Get these errors:

(weewx-venv) xxx@###:~/weewx-data$ weectl database add-column test
Using configuration file /home/jnz/weewx-data/weewx.conf
Traceback (most recent call last):
  File "/home/xxx/weewx-venv/bin/weectl", line 8, in <module>
    sys.exit(main())
  File "/home/xxx/weewx-venv/lib/python3.10/site-packages/weectl.py", line 66, in main
    namespace.func(namespace)
  File "/home/xxx/weewx-venv/lib/python3.10/site-packages/weectllib/__init__.py", line 96, in dispatch
    namespace.action_func(config_dict, namespace)
  File "/home/xxx/weewx-venv/lib/python3.10/site-packages/weectllib/database_cmd.py", line 342, in add_column
    weectllib.database_actions.add_column(config_dict,
  File "/home/xxx/weewx-venv/lib/python3.10/site-packages/weectllib/database_actions.py", line 157, in add_column
    manager_dict = weewx.manager.get_manager_dict_from_config(config_dict, db_binding)
  File "/home/xxx/weewx-venv/lib/python3.10/site-packages/weewx/manager.py", line 886, in get_manager_dict_from_config
    manager_dict['schema'] = weeutil.weeutil.get_object(schema_name)
  File "/home/xxx/weewx-venv/lib/python3.10/site-packages/weeutil/weeutil.py", line 1404, in get_object
    module = importlib.import_module(module_name)
  File "/usr/lib/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 992, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1004, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'user'

Any ideas?
Thanks!

steepleian

unread,
Dec 29, 2023, 8:35:11 AM12/29/23
to weewx...@googlegroups.com
I have an identical error when using weectl report run with v5rc1

On 29 Dec 2023, at 13:27, 'neutrino' via weewx-user <weewx...@googlegroups.com> wrote:


--
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/ae5b4963-63a5-46e8-bb16-e0d8b2099203n%40googlegroups.com.

Cameron D

unread,
Dec 29, 2023, 9:46:16 AM12/29/23
to weewx-user
Matthew has just announced a pip release of rc2, which probably fixes the user module path problem in weectl.

Steeple Ian

unread,
Dec 29, 2023, 5:16:27 PM12/29/23
to weewx-user
Apologies for the half-response. I meant to add that 5.0.0rc2 solves this problem for me.

neutrino

unread,
Dec 30, 2023, 4:26:22 AM12/30/23
to weewx-user
Thanks for your information, unfortunately upgading to  weewx-5.0.0rc2 did not solve this problem for me.
If I can help debugging drop me a line
Best regards

Tom Keffer

unread,
Dec 30, 2023, 5:58:11 PM12/30/23
to weewx-user
Mr Neutrino: could you set debug=1, try again, then post the actual log? It will show more information than just the stack trace.

neutrino

unread,
Dec 31, 2023, 9:58:22 AM12/31/23
to weewx-user
Thanks, did it already, even within PyCharm debug, but could not find the source of the problem. I spent a hour to find what config entry caused the problem with my years old installation, but was not successful.
I finally got it solved by using a freshly created weewx.conf (besides my orginal config), after all renaming/adding/dropping of columns I switched back.
Many thanks for you help, and
Happy New Year
to everyone.

Tom Keffer

unread,
Dec 31, 2023, 10:38:03 AM12/31/23
to weewx...@googlegroups.com
Glad you got it working, but it would be nice to know what the original problem was...

Reply all
Reply to author
Forward
0 new messages