The error 'file' is not defined was fixed in WeeWX V4 as part of the port
to Python 3. You will get LOTS of these kinds of errors trying to run WeeWX
V3 under Python 3. Either upgrade WeeWX first, or use Python 2.7.

On Mon, Dec 7, 2020 at 9:44 AM Gordon Dickens <[email protected]> wrote:

> Hello all,
>
> I have been successfully running the following versions of weewx software,
> skins and python on Debian 10 and I need to upgrade the software as
> depicted here:
>
>    - weewx current version 3.9.2 needs upgrading to 4.2.0.
>    - Belchertown Skin current version 1.0.1 needs upgrading to 1.2
>    - Weather34 Skin current version WX-UB40-IHVN-0.9.1 needs upgrading
>    toW34-HC-IMJD-3.0.0
>    - Python current version 2.7 needs upgrading to Python 3.7.3
>
> As an FYI, weewx is installed from the Debian weewx package with the
> Debian package manager, apt.
>
> What is the recommended order for performing these upgrades?
>
> My initial thoughts were to upgrade in this order:
>
>    1. Upgrade Python to version 3.7.3
>    2. Upgrade weew to version 4.2.0
>    3. Upgrade the Belchertown skin to verion 1.2
>    4. Upgrade the Weather34 skin to version W34-HC-IMJD-3.0.0
>
> So, I began the python upgrade by installing python 3.7.3 and the python3
> dependencies: python3-configobj python3-pil  python3-serial, python3-usb,
> python3-pip, python3-cheetah,  python3-ephem, python3-mysqldb.
>
> I then used the update-alternatives package to switch the default python
> command to python 3.7.3.  Then, after I started the weewx service with
> "systemctl restart weewx", the command "systemctl status weewx" generates
> the following error dialog:
>
> ● weewx.service - LSB: weewx weather system
>    Loaded: loaded (/etc/init.d/weewx; generated)
>    Active: active (exited) since Mon 2020-12-07 09:12:53 EST; 7s ago
>      Docs: man:systemd-sysv-generator(8)
>   Process: 28868 ExecStart=/etc/init.d/weewx start (code=exited,
> status=0/SUCCESS)
>
> Dec 07 09:12:53 zeebytes.org weewx[28868]: Starting weewx weather system:
> weewxTraceback (most recent call last):
> Dec 07 09:12:53 zeebytes.org weewx[28868]:   File "/usr/bin/weewxd", line
> 64, in <module>
> Dec 07 09:12:53 zeebytes.org weewx[28868]:     weewx.engine.main(options,
> args)
> Dec 07 09:12:53 zeebytes.org weewx[28868]:   File
> "/usr/share/weewx/weewx/engine.py", line 845, in main
> Dec 07 09:12:53 zeebytes.org weewx[28868]:
> daemon.daemonize(pidfile=options.pidfile)
> Dec 07 09:12:53 zeebytes.org weewx[28868]:   File
> "/usr/share/weewx/daemon.py", line 71, in daemonize
> Dec 07 09:12:53 zeebytes.org weewx[28868]:     si = file(stdin, 'r')
> Dec 07 09:12:53 zeebytes.org weewx[28868]: NameError: name 'file' is not
> defined
> Dec 07 09:12:53 zeebytes.org weewx[28868]: .
> Dec 07 09:12:53 zeebytes.org systemd[1]: Started LSB: weewx weather
> system.
>
> I researched "NameError: name 'file' is not defined" and found a reference
> that stated that file() is not supported in Python3.  Is that the problem
> and if so, how do I fix it?  Otherwise, how do I get my existing weewx
> 3.9.2 installation to run Python3 or do I need to upgrade weewx to 4.2.0
> for it to work with python3?
>
> Any comments on the best way to perform these upgrades would be most
> appreciated.
>
> Thanks,
>
> Gordon
>
> --
> 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 on the web visit
> https://groups.google.com/d/msgid/weewx-user/988598aa-d167-48cc-b591-ca740d6b9afen%40googlegroups.com
> <https://groups.google.com/d/msgid/weewx-user/988598aa-d167-48cc-b591-ca740d6b9afen%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 on the web visit 
https://groups.google.com/d/msgid/weewx-user/CAPq0zEA5QxUx855e%3DZ%3DYMszbzZiq2khJMu%3DZzDLJa%2B4W6jycxw%40mail.gmail.com.

Reply via email to