Python and depdency failures on CentOS 8

106 views
Skip to first unread message

Jared

unread,
Oct 17, 2019, 9:16:05 AM10/17/19
to weewx-user
Hi,

I'm trying to do a new Weewx installation on CentOS 8 and I'm having some installation issues regarding python that I can't figure out.  I know the basics of Linux but am not a veteran.  I'm following the instructions on the http://www.weewx.com/docs/redhat.htm page.

I installed as many of the prerequisites as I could.  None of the commands worked as-is.  First I installed python 2 with sudo yum install python2 and then I was able to run sudo yum install python2-cheetah and sudo pip2 install pyserial and sudo pip2 install pyusb.  The only other package name I got a result for was on sudo yum install python2-setuptools but it said this was installed already.

At this point I figured I would at least try to run the Weewx install, so I got the .rpm file and attempted to install it with rpm -i.  But it failed all python dependencies.

error: Failed dependencies:
        python is needed by weewx-3.9.2-1.rhel.noarch
        python-cheetah is needed by weewx-3.9.2-1.rhel.noarch
        python-configobj is needed by weewx-3.9.2-1.rhel.noarch
        python-imaging is needed by weewx-3.9.2-1.rhel.noarch
        python-setuptools is needed by weewx-3.9.2-1.rhel.noarch



I'm sure something is goofy with having by python2 and python3 on the same OS.  I couldn't run python by itself, so I looked around as best I could and wound up running sudo alternatives --set python /usr/bin/python2 but this didn't make the rpm any happier.

The output of whereis python returns:

python: /usr/bin/python2.7 /usr/bin/python /usr/lib/python3.6 /usr/lib/python2.7 /usr/lib64/python3.6 /usr/lib64/python2.7 /usr/include/python3.6m /usr/include/python2.7 /usr/share/man/man1/python.1.gz


Other potentially useful info:

[me@SERVER ~]$ ls -alh /usr/bin | grep python
lrwxrwxrwx   1 root root      36 Oct 17 07:32 python -> /etc/alternatives/unversioned-python
lrwxrwxrwx   1 root root       9 Oct  8 17:08 python2 -> python2.7
-rwxr-xr-x   1 root root    9.1K Oct  8 17:08 python2.7
lrwxrwxrwx   1 root root      24 Oct 17 07:32 unversioned-python -> /etc/alternatives/python
[me@SERVER ~]$ ls -alh /usr/lib | grep python
drwxr-xr-x    3 root root   27 Oct 16 14:06 python2.7
drwxr-xr-x.   3 root root   27 Oct  7 14:00 python3.6
[me@SERVER ~]$


I figure at this point any tinkering will only make the problem worse, so I thought it was a good time to reach out.


Thanks.

vince

unread,
Oct 17, 2019, 10:20:36 AM10/17/19
to weewx-user
Is there a reason you need to do this on centos8 ?
That's very new and very different under the hood from a python perspective than previous versions (long story).

I think what you are likely running into is internals in the rpms themselves and what they say they 'provide' in rpm terminology.  I'm guessing the python2 rpm provides "python2" but no rpm provides "python" (unversioned), so the legacy weewx rpms will not work as is on the new os.

The setup.py installation method should work for you just fine I'd think (untested).

But personally I'd recommend you just use centos7 since it's supported for 4+ more years anyway, unless you really want to go bleeding edge with centos8.

vince

unread,
Oct 17, 2019, 11:21:27 AM10/17/19
to weewx-user
Geez RHEL8/CentOS8 is UGLY under the hood in how it does repos.

  • I verified that no package "provides" python, so the existing rpm for weewx will not work as-is.
  • You are 'definitely' going to have significant problems trying to force a weewx rpm installation to happen on centos8.

I'd highly recommend going the 'setup.py' route for installing things.  You might also need to install the prerequisite packages the hard way if EPEL hasn't caught up (which reports say is the case).

Jared

unread,
Oct 17, 2019, 11:26:54 AM10/17/19
to weewx-user
Thanks, that's great info.  I don't mind going CentOS 7.  I figured CentOS 8 would be a good learning experience as a Linux noob, but if it's that much trouble then it's not worth it.  I'm guessing by the time I'd need CentOS 8 I'll be able to move to Weewx 4 anyway.  Or maybe I'll mess with it later if I'm feeling up to it.  At this point I just want to get off the ground.

Thanks very much for your help.

vince

unread,
Oct 17, 2019, 11:52:11 AM10/17/19
to weewx-user
On Thursday, October 17, 2019 at 8:26:54 AM UTC-7, Jared wrote:
Thanks, that's great info.  I don't mind going CentOS 7.  I figured CentOS 8 would be a good learning experience as a Linux noob, but if it's that much trouble then it's not worth it.  I'm guessing by the time I'd need CentOS 8 I'll be able to move to Weewx 4 anyway.  Or maybe I'll mess with it later if I'm feeling up to it.  At this point I just want to get off the ground.


If you want maximum weewx compatibility, then I'd suggest you go with ubuntu or debian, especially if you're a Linux newbie.


Jared

unread,
Oct 17, 2019, 12:22:24 PM10/17/19
to weewx-user
Why is that, just curious.  I have no issue with Debian, it's just that CentOS is more relevant to me professionally.

vince

unread,
Oct 17, 2019, 12:54:05 PM10/17/19
to weewx-user
On Thursday, October 17, 2019 at 9:22:24 AM UTC-7, Jared wrote:
Why is that, just curious.  I have no issue with Debian, it's just that CentOS is more relevant to me professionally.



Centos7 is fine to use.  There are just many many more weewx users on debian derivatives (raspi) and it's kinda historically the reference platform weewx was built on.

Just don't go totally bleeding edge latest centos8 or fedora and expect everything to work.  They tends to break things historically.

WindnFog

unread,
Oct 23, 2019, 10:10:40 AM10/23/19
to weewx-user
I agree.  The development "cycle" is Fedora (a combo of alpha/beta testing of the "new" Redhat), then Redhat X (with paid support), and CentOS X (which is Redhat X with no paid support.)   CentOS tends to be ultra-conservative and hangs around web hosting installations several version old (my web hosting company is still running clusters of CentOS 5 and 6.)  CentOS is stable and the "go-to" if you don't like change (and you can live without the bleeding edge.)  Even CentOS 8.0 is OK, although it was released just four days after CentOS 7.7.  It probably still has a few bugs, so I'd stick with Centos 7 for awhile.

I ran my Weewx system on CentOS 6 and 7 for over four years.  In my view, Centos is an enterprise OS and it was overkill for Weewx, so I switched to an R Pi and Rasbian.  That said, CentOS will give you about as stable a Linux platform as any IF you stay away from the latest, greatest release for a few months.  CentOS 8.0 will settle down after a few months of updates.  CentOS is a "safe" and "stable" Linux distro, but it lags in terms of fancy "Fedora" type bells and whistles by 1-2 years.

- Paul VE1DX
Reply all
Reply to author
Forward
0 new messages