Error in weewxd at start

163 views
Skip to first unread message

Andrea

unread,
Jun 8, 2024, 5:12:27 AMJun 8
to weewx-user
hello, 
after restart the PC, I tried to start weewx with this steps:
python3 -m venv ~/weewx-venv
source ~/weewx-venv/bin/activate
weewxd &
but I received the message
   from weewxd import main
ModuleNotFoundError: No module named 'weewxd'

Weewx has been running up to before restart the PC.
I use Manjaro and weewx 5.0

Thanks for your help
Andrea

Tom Keffer

unread,
Jun 9, 2024, 1:32:32 PMJun 9
to weewx...@googlegroups.com
Your message is a little confusing. From what you wrote, it looks like you created a virtual environment, then activated it, then tried to run weewxd. 

However, the normal sequence is to create the virtual environment, activate it, install WeeWX, then run weewxd.

Did you install WeeWX?

-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/f3d18dee-ee4c-4309-b3be-cc40febc4472n%40googlegroups.com.

Andrea

unread,
Jun 10, 2024, 3:39:40 AMJun 10
to weewx-user
Hi Tom.
Yes, weewx was running since February. Every Weeks I restart the PC and always weewx running normal. Yesterday, suddenly, doesn't work anymore.
I use virtual environment with the command source.... and then launch weewxd.
thanks
Andrea

Andrea

unread,
Jun 10, 2024, 5:10:11 AMJun 10
to weewx-user
Maybe I found the problem. With last system update, the new version of Python was installed and Weewx doesn't runnig because all the software is in  the previous version directory ../weewx-venv/lib/python3.11/site-packages/"
I copied all the software in the new directory ../...python3.12/site-packages and everythng is ok again.

now weewx is up and runnig !
thanks
Andrea

Andrea

unread,
Jun 10, 2024, 5:25:07 AMJun 10
to weewx-user
there's still a problem with Pillow

Il giorno lunedì 10 giugno 2024 alle 09:39:40 UTC+2 Andrea ha scritto:

steepleian

unread,
Jun 10, 2024, 6:20:59 AMJun 10
to weewx...@googlegroups.com
Tom,
I know of another user who had an identical problem with Manjaro when Python was updated to 3.12. With a self contained virtual environment I was surprised this happened. Is this worth further investigation?
I.


On 10 Jun 2024, at 11:25, Andrea <anicol...@gmail.com> wrote:

there's still a problem with Pillow

vince

unread,
Jun 10, 2024, 12:38:17 PMJun 10
to weewx-user
Maybe. I suppose a potential change would be in how weewx generates its ExecStart string.

Installing weewx via "python3 -m venv weewx-venv" generates the following:
      ExecStart=/home/pi/weewx-venv/bin/python3 /home/pi/weewx-venv/lib/python3.9/site-packages/weewxd.py /home/pi/weewx-data/weewx.conf

But... if I had installed weewx via "python3.9 -m venv weewx-venv" there's a different result....
  ExecStart=/home/pi/weewx-venv/bin/python3.9 /home/pi/weewx-venv/lib/python3.9/site-packages/weewxd.py /home/pi/weewx-data/weewx.conf

So for this second example I could 'add' a new python 3.12 to my os safely 'if' the old 3.9 was left unaltered.  I don't know if every os would do so, however.  This might be os specific.

I guess there are a couple options for potential change:
  • make the ExecStart string generation smarter and figure out that python3 points to python3.9 when you follow the symlinks
  • or change the procedure or add a note suggesting using pythonX.Y (whatever your os is using) to protect against this situation

steepleian

unread,
Jun 10, 2024, 12:47:15 PMJun 10
to weewx...@googlegroups.com
Vince,
For me the second option is preferable as I assume that it would preserve the existing Python version until WeeWX deems it necessary to upgrade.


On 10 Jun 2024, at 18:38, vince <vince...@gmail.com> wrote:

Maybe. I suppose a potential change would be in how weewx generates its ExecStart string.

Sanjiv B

unread,
Jun 11, 2024, 5:10:43 PMJun 11
to weewx-user
Thanks for your response Tom! You are the best!

I don't think I started it properly using the SystemD startup scripts.

I fixed this problem by turning off debugging
debug=0

However, I am uncertain if that fixed it OR if it is because I used the startup in SystemD. The data reports perfectly now!

Reply all
Reply to author
Forward
0 new messages