Agree.

Check to verify that you have a dpkg installation installed - it should 
look like this:

$ dpkg -l weewx
Desired=Unknown/Install/Remove/Purge/Hold
| 
Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name           Version      Architecture Description
+++-==============-============-============-=================================
ii  weewx          5.2.0-1      all          weather software

And check to see what's where:

vagrant@weewx-dpkg:~$ ls -al /usr/bin/wee* /usr/local/bin/wee*
ls: cannot access '/usr/local/bin/wee*': No such file or directory
-rwxr-xr-x 1 root root 313 Oct  6 01:16  /usr/bin/weectl
-rwxr-xr-x 1 root root 313 Oct  6 01:16  /usr/bin/weewxd

Regardless, /usr/local/bin is definitely very very odd.

If you have stuff in both places for some reason, /usr/local/bin is going 
to win because that comes first in your $PATH.
vagrant@weewx-dpkg:~$ echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games

If so, you might try "/usr/bin/weectl" and "/usr/bin/weewxd" and give the 
full pathname to see if it magically works as a quick test.  That might 
help verify your dpkg installation (if one is there) is ok.

If you have both a dpkg and some old/other installation and you want to use 
the dpkg one:

   - at a minimum rename the wee* stuff in /usr/local/bin (so it's not 
   found)
   - verify the contents of your weewx.service file 
      - which should be in /usr/lib/systemd/system 
      - and it should point to your weewx.conf in /etc/weewx
   - if the service file is messed up, the template to copy from is in 
   /etc/weewx/systemd
   - and "sudo systemctl daemon-reload" if you mess with systemd service 
   files

There is a more remote possibility that you might even have two 
weewx.service files installed.  The dpkg installs under /usr but you might 
have more old cruft under /etc which will take precedence unfortunately. 
 I've seen this happen to me ages ago with running some upgrade scenarios. 
  A clean dpkg installation would look like:

vagrant@weewx-dpkg:~$ ls -al /usr/lib/systemd/system/wee*service 
/etc/systemd/system/wee*
ls: cannot access '/etc/systemd/system/wee*': No such file or directory
-rw-r--r-- 1 root root 424 Jan  7 20:43 
 /usr/lib/systemd/system/weewx.service
-rw-r--r-- 1 root root 932 Jan  7 20:43 
 /usr/lib/systemd/system/[email protected]

But if you have two installations in different places you'll have to pick 
one and clean up the other...

On Wednesday, January 7, 2026 at 1:08:15 PM UTC-8 Tom Keffer wrote:

> In a Debian package install, the shims weewxd and weectl are *shell 
> scripts* that are normally installed into /usr/bin. The files weewxd.py 
> and weectl.py are Python code and are normally installed in 
> /usr/share/weewx. The shell scripts load the Python scripts.
>
> Your instance /usr/local/bin/weectl seems to be a Python script that is 
> trying to import the main module. That's the way the *pip install* works, 
> not the Debian install.
>
> I suspect that you somehow got a pip install and a Debian package install 
> scrambled together. You'll have to look around the usual places to figure 
> out how to unscramble them. 
>
> From the limited information, that's all I can come up with.
>
> -tk
>
>
>
> On Wed, Jan 7, 2026 at 12:39 PM Greg <[email protected]> wrote:
>
>> Sorry, I didn't think it was a unusual setup. I used the installer apt in 
>> Ubuntu 20,. "apt install weewx" I thought that was the standard way to 
>> install? 
>> I updated to Ubuntu 22 and then 24 today when I now get that error. It's 
>> weewx version 5.2.0-1. I'm using a  Ecowitt gateway, driver = 
>> user.gw1000. It has been working fine for a while until the Ubuntu update.
>> It's Python 3.12.3. 
>> Static IP for the server. 
>>
>> "weectl diag" gives me an error:
>>
>> Traceback (most recent call last):
>>   File "/usr/local/bin/weectl", line 5, in <module>
>>     from weectl import main
>> ModuleNotFoundError: No module named 'weectl'
>>
>>
>> Thanks
>>
>>
>> On Wednesday, January 7, 2026 at 2:26:03 PM UTC-5 Vince Skahan wrote:
>>
>>> If you refuse to actually describe your very unusual setup, you're not 
>>> going to get a lot of help here too quickly.....
>>>
>>> On Wednesday, January 7, 2026 at 11:18:27 AM UTC-8 Greg wrote:
>>>
>>>>
>>>>
>>>> I can run it on the command line "python3 /usr/share/weewx/weewxd.py"
>>>>
>>>> I guess it is a path issue. 
>>>>
>>>> Seems like the Linux service calls: /usr/local/bin/weewxd to start the 
>>>> service.
>>>>
>>>> Which is trying to do an import of main from weewxd  ie line #5: "from 
>>>> weewxd import main"
>>>>
>>>> I guess it can't find weewxd?
>>>>
>>>> Is there a better way to start it as a service?
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> On Wednesday, January 7, 2026 at 1:51:57 PM UTC-5 Vince Skahan wrote:
>>>>
>>>>> Need much more info.
>>>>>
>>>>>
>>>>> https://github.com/vinceskahan/weewx-getting-started/blob/main/how-to-report-a-problem.md
>>>>>
>>>>> Quick guess is your very unusual path of /usr/local/bin is where to 
>>>>> start looking.
>>>>>
>>>>> On Wednesday, January 7, 2026 at 10:47:02 AM UTC-8 Greg wrote:
>>>>>
>>>>>> Hi, I'm getting an error when the service starts after upgrading to 
>>>>>> Ubuntu 24:
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> *Jan 07 11:25:33 htpctemp weewxd[32126]:   File 
>>>>>> "/usr/local/bin/weewxd", line 5, in <module>Jan 07 11:25:33 htpctemp 
>>>>>> weewxd[32126]:     from weewxd import mainJan 07 11:25:33 htpctemp 
>>>>>> weewxd[32126]: ModuleNotFoundError: No module named 'weewxd'Jan 07 
>>>>>> 11:25:33 
>>>>>> htpctemp systemd[1]: weewx.service: Main process exited, code=exited, 
>>>>>> status=1/FAILUREJan 07 11:25:33 htpctemp systemd[1]: weewx.service: 
>>>>>> Failed 
>>>>>> with result 'exit-code'.*
>>>>>>
>>>>>> Any ideas? Did find anything searching via Google.
>>>>>>
>>>>>> Thanks, Greg
>>>>>>
>>>>> -- 
>> 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/f757f702-5bba-4ac1-9e9a-df16877401cen%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/weewx-user/f757f702-5bba-4ac1-9e9a-df16877401cen%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
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/92c298c2-b38f-4716-aa5c-e0336c651e1bn%40googlegroups.com.

Reply via email to