Python installation woes

101 views
Skip to first unread message

Steve London

unread,
Aug 7, 2019, 3:13:06 PM8/7/19
to weewx-user
Trying to install weewx on Raspbian. Python has never (successfully) been installed on this rPi. Here's the errors. Suggestions ?

Thanks !

pi@raspberrypi:~ $ sudo apt-get install weewx
Reading package lists... Done
Building dependency tree      
Reading state information... Done
weewx is already the newest version (3.9.2-1).
The following packages were automatically installed and are no longer required:
  libfile-copy-recursive-perl openbsd-inetd update-inetd
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 120 not upgraded.
5 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up python-configobj (5.0.6-2) ...
  File "/usr/lib/python2.7/encodings/__init__.py", line 1
SyntaxError: Non-ASCII character '\xa4' in file /usr/lib/python2.7/encodings/__init__.py on line 1, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details
dpkg: error processing package python-configobj (--configure):
 subprocess installed post-installation script returned error exit status 1
Setting up python-usb (1.0.0-1) ...
  File "/usr/lib/python2.7/encodings/__init__.py", line 1
SyntaxError: Non-ASCII character '\xa4' in file /usr/lib/python2.7/encodings/__init__.py on line 1, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details
dpkg: error processing package python-usb (--configure):
 subprocess installed post-installation script returned error exit status 1
Setting up python-imaging (4.0.0-4) ...
  File "/usr/lib/python2.7/encodings/__init__.py", line 1
SyntaxError: Non-ASCII character '\xa4' in file /usr/lib/python2.7/encodings/__init__.py on line 1, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details
dpkg: error processing package python-imaging (--configure):
 subprocess installed post-installation script returned error exit status 1
Setting up python-cheetah (2.4.4-4) ...
  File "/usr/lib/python2.7/encodings/__init__.py", line 1
SyntaxError: Non-ASCII character '\xa4' in file /usr/lib/python2.7/encodings/__init__.py on line 1, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details
dpkg: error processing package python-cheetah (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of weewx:
 weewx depends on python-configobj (>= 4.5); however:
  Package python-configobj is not configured yet.
 weewx depends on python-cheetah (>= 2.0); however:
  Package python-cheetah is not configured yet.
 weewx depends on python-imaging (>= 1.1.6) | python-pil (>= 5.1.0) | python-pillow (>= 5.1.0); however:
  Package python-imaging is not configured yet.
  Version of python-pil:armhf on system is 4.0.0-4.
  Package python-pillow is not installed.
  Version of python-pillow on system, provided by python-pil:armhf, is <none>.
 weewx depends on python-usb (>= 0.4); however:
  Package python-usb is not configured yet.

dpkg: error processing package weewx (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 python-configobj
 python-usb
 python-imaging
 python-cheetah
 weewx

Thomas Keffer

unread,
Aug 7, 2019, 3:30:53 PM8/7/19
to weewx-user
It does look like you have a problem with your Python installation. Try the following:

python -c "print('hello world!')"

If it creates an error, your Python is broken.

-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/90edf5bb-baa8-4f24-8a71-c9eb91adfc07%40googlegroups.com.

Thomas Keffer

unread,
Aug 7, 2019, 4:35:54 PM8/7/19
to weewx-user
That proves nothing: the configuration file in the distribution does not come with a driver declared. Hence the "unspecified" driver.

Humor me and run weewx again, this time posting the log (/var/log/syslog).

sudo systemctl start weewx

-tk


On Wed, Aug 7, 2019 at 1:26 PM Steve London <n2ic...@gmail.com> wrote:
Python is still hosed I suspect. I ran it manually with the weewx.conf.dist :

pi@raspberrypi:/usr/bin $ sudo ./weewxd /etc/weewx/weewx.conf.dist
Traceback (most recent call last):
   File "./weewxd", line 64, in <module>
     weewx.engine.main(options, args)
   File "/usr/share/weewx/weewx/engine.py", line 888, in main
     engine = engine_class(config_dict)
   File "/usr/share/weewx/weewx/engine.py", line 72, in __init__
     self.setupStation(config_dict)
   File "/usr/share/weewx/weewx/engine.py", line 90, in setupStation
     driver = config_dict[stationType]['driver']
   File "/usr/lib/python2.7/dist-packages/configobj.py", line 554, in __getitem__
     val = dict.__getitem__(self, key)
KeyError: 'unspecified




On 08/07/2019 02:10 PM, Thomas Keffer wrote:
> What makes you think it's not running? Did you look in the system log? What does
> it say?
>
> You're not giving us much to go on!
>
> -tk
>
> On Wed, Aug 7, 2019 at 1:04 PM Steve London <n2ic...@gmail.com
> <mailto:n2ic...@gmail.com>> wrote:
>
>     Thanks.
>
>     After a number of kludges, I seem to have python working and weewx claims to be
>     installed.
>
>     However, it doesn't seem to run at all. Here's the output from
>     /etc/init.d/weewx
>     start.
>
>     Thanks,
>     Steve
>
>     pi@raspberrypi:/etc/init.d $ sudo ./weewx start
>     + PATH=/sbin:/usr/sbin:/bin:/usr/bin
>     + WEEWX_BIN=/usr/bin/weewxd
>     + WEEWX_CFG=/etc/weewx/weewx.conf
>     + WEEWX_USER=root:root
>     + DESC=weewx weather system
>     + NAME=weewx
>     + PIDFILE=/var/run/weewx.pid
>     + [ -r /etc/default/weewx ]
>     + [ -x /usr/bin/weewxd ]
>     + DAEMON=/usr/bin/weewxd
>     + DAEMON_ARGS=--daemon --pidfile=/var/run/weewx.pid /etc/weewx/weewx.conf
>     + . /lib/init/vars.sh
>     + TMPTIME=0
>     + SULOGIN=no
>     + DELAYLOGIN=no
>     + UTC=yes
>     + VERBOSE=no
>     + FSCKFIX=no
>     + [ -f /etc/default/rcS ]
>     + unset EDITMOTD
>     + unset RAMRUN
>     + unset RAMLOCK
>     + [ -r /proc/cmdline ]
>     + cat /proc/cmdline
>     + [  ]
>     + [  ]
>     + . /lib/lsb/init-functions
>     + run-parts --lsbsysinit --list /lib/lsb/init-functions.d
>     + [ -r /lib/lsb/init-functions.d/20-left-info-blocks ]
>     + . /lib/lsb/init-functions.d/20-left-info-blocks
>     + [ -r /lib/lsb/init-functions.d/40-systemd ]
>     + . /lib/lsb/init-functions.d/40-systemd
>     + _use_systemctl=0
>     + [ -d /run/systemd/system ]
>     + prog=weewx
>     + service=weewx.service
>     + systemctl -p LoadState --value show weewx.service
>     + state=loaded
>     + [ loaded = masked ]
>     + [ 1849 -ne 1 ]
>     + [ -z  ]
>     + readlink -f ./weewx
>     + [ loaded != not-found ]
>     + _use_systemctl=1
>     + systemctl -p CanReload --value show weewx.service
>     + [ yes = no ]
>     + [ 1 = 1 ]
>     + set +e
>     + set +u
>     + [ xstart = xstart -o xstart = xstop -o xstart = xrestart -o xstart = xreload
>     -o xstart = xforce-reload -o xstart = xtry-restart -o xstart = xstatus ]
>     + systemctl_redirect ./weewx start
>     + local s
>     + local rc
>     + local prog=weewx
>     + local command=start
>     + s=Starting weewx (via systemctl)
>     + service=weewx.service
>     + systemctl is-system-running
>     + OUT=running
>     + [ start = status ]
>     + log_daemon_msg Starting weewx (via systemctl) weewx.service
>     + [ -z Starting weewx (via systemctl) ]
>     + log_daemon_msg_pre Starting weewx (via systemctl) weewx.service
>     + log_use_fancy_output
>     + TPUT=/usr/bin/tput
>     + EXPR=/usr/bin/expr
>     + [ -t 1 ]
>     + [ xxterm-256color != x ]
>     + [ xxterm-256color != xdumb ]
>     + [ -x /usr/bin/tput ]
>     + [ -x /usr/bin/expr ]
>     + /usr/bin/tput hpa 60
>     + /usr/bin/tput setaf 1
>     + [ -z ]
>     + FANCYTTY=1
>     + true
>     + echo -n [....]
>     [....] + [ -z weewx.service ]
>     + echo -n Starting weewx (via systemctl): weewx.service
>     Starting weewx (via systemctl): weewx.service+ log_daemon_msg_post Starting
>     weewx (via systemctl) weewx.service
>     + :
>     + /bin/systemctl --no-pager start weewx.service
>     Warning: weewx.service changed on disk. Run 'systemctl daemon-reload' to reload
>     units.
>     + rc=0
>     + [ start = status ]
>     + log_end_msg 0
>     + [ -z 0 ]
>     + local retval
>     + retval=0
>     + log_end_msg_pre 0
>     + log_use_fancy_output
>     + TPUT=/usr/bin/tput
>     + EXPR=/usr/bin/expr
>     + [ -t 1 ]
>     + [ xxterm-256color != x ]
>     + [ xxterm-256color != xdumb ]
>     + [ -x /usr/bin/tput ]
>     + [ -x /usr/bin/expr ]
>     + /usr/bin/tput hpa 60
>     + /usr/bin/tput setaf 1
>     + [ -z 1 ]
>     + true
>     + true
>     + /usr/bin/tput setaf 1
>     + RED=
>     + /usr/bin/tput setaf 2
>     + GREEN=
>     + /usr/bin/tput setaf 3
>     + YELLOW=
>     + /usr/bin/tput op
>     + NORMAL=
>     + /usr/bin/tput civis
>     + /usr/bin/tput sc
>     + /usr/bin/tput hpa 0
>     + [ 0 -eq 0 ]
>     + /bin/echo -ne [ ok
>     [ ok + /usr/bin/tput rc
>     + /usr/bin/tput cnorm
>     + log_use_fancy_output
>     + TPUT=/usr/bin/tput
>     + EXPR=/usr/bin/expr
>     + [ -t 1 ]
>     + [ xxterm-256color != x ]
>     + [ xxterm-256color != xdumb ]
>     + [ -x /usr/bin/tput ]
>     + [ -x /usr/bin/expr ]
>     + /usr/bin/tput hpa 60
>     + /usr/bin/tput setaf 1
>     + [ -z 1 ]
>     + true
>     + true
>     + /usr/bin/tput setaf 1
>     + RED=
>     + /usr/bin/tput setaf 3
>     + YELLOW=
>     + /usr/bin/tput op
>     + NORMAL=
>     + [ 0 -eq 0 ]
>     + echo .
>     .
>     + log_end_msg_post 0
>     + :
>     + return 0
>     + return 0
>     + exit 0

>
>
>     On 08/07/2019 01:30 PM, Thomas Keffer wrote:
>      > It does look like you have a problem with your Python installation. Try the
>      > following:
>      >
>      >     *python -c "print('hello world!')"*

>      >
>      >
>      > If it creates an error, your Python is broken.
>      >
>      > -tk
>      >
>      > On Wed, Aug 7, 2019 at 12:14 PM Steve London <n2ic...@gmail.com
>     <mailto:n2ic...@gmail.com>

>      >     To view this discussion on the web visit
>      >
>     https://groups.google.com/d/msgid/weewx-user/90edf5bb-baa8-4f24-8a71-c9eb91adfc07%40googlegroups.com
>      >   

>      >
>      > --
>      > 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
>      >

Thomas Keffer

unread,
Aug 7, 2019, 4:47:10 PM8/7/19
to weewx-user
I'm sorry, but you're on your own for that!

It might be easier to just re-install the operating system.

-tk

On Wed, Aug 7, 2019 at 1:40 PM Steve London <n2ic...@gmail.com> wrote:
Too late. I removed python2.7. Now I get this when I try to install it:

Setting up python2.7 (2.7.13-2+deb9u3) ...
Sorry: TypeError: compile() expected string without null bytes
Sorry: TypeError: compile() expected string without null bytes

Suggestions ?

Sorry, but I am a C, C#, VB.Net person, not python. The only reason I have come
down this road is that I just replaced a Acurite weather station. The old one
ran fine for years with rtl_433 from the deserthome guy. The new one just gives
CRC failures running that version of rtl_433. Wanted to try weewx before sending
it back.

Steve


On 08/07/2019 02:35 PM, Thomas Keffer wrote:
> That proves nothing: the configuration file in the distribution does not come
> with a driver declared. Hence the "unspecified" driver.
>
> Humor me and run weewx again, this time posting the log (/var/log/syslog).
>
> *sudo systemctl start weewx*
>      >     <mailto:weewx-user%2Bunsu...@googlegroups.com
>     <mailto:weewx-user%252Buns...@googlegroups.com>>
>      >      >     <mailto:weewx-user+...@googlegroups.com
>     <mailto:weewx-user%2Bunsu...@googlegroups.com>
>      >     <mailto:weewx-user%2Bunsu...@googlegroups.com
>     <mailto:weewx-user%252Buns...@googlegroups.com>>>.

>      >      >     To view this discussion on the web visit
>      >      >
>      >
>     https://groups.google.com/d/msgid/weewx-user/90edf5bb-baa8-4f24-8a71-c9eb91adfc07%40googlegroups.com
>      >      >
>      >     
>       <https://groups.google.com/d/msgid/weewx-user/90edf5bb-baa8-4f24-8a71-c9eb91adfc07%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 weewx-user+...@googlegroups.com
>     <mailto:weewx-user%2Bunsu...@googlegroups.com>
>      >     <mailto:weewx-user%2Bunsu...@googlegroups.com
>     <mailto:weewx-user%252Buns...@googlegroups.com>>
>      >      > <mailto:weewx-user+...@googlegroups.com
>     <mailto:weewx-user%2Bunsu...@googlegroups.com>
>      >     <mailto:weewx-user%2Bunsu...@googlegroups.com
>     <mailto:weewx-user%252Buns...@googlegroups.com>>>.

>      >      > To view this discussion on the web visit
>      >      >
>      >
>     https://groups.google.com/d/msgid/weewx-user/CAPq0zEAg9pRj-4%3DCBZNtVecjB0TYFoxguG5qx9YnuhjME4%3DNjA%40mail.gmail.com
>      >
>      >      >
>      >   
>       <https://groups.google.com/d/msgid/weewx-user/CAPq0zEAg9pRj-4%3DCBZNtVecjB0TYFoxguG5qx9YnuhjME4%3DNjA%40mail.gmail.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 weewx-user+...@googlegroups.com

> To view this discussion on the web visit

rich T

unread,
Aug 7, 2019, 5:32:35 PM8/7/19
to weewx-user
Reply all
Reply to author
Forward
0 new messages