Broken python dependency with CentOS 8

2,830 views
Skip to first unread message

David

unread,
May 28, 2020, 10:35:28 AM5/28/20
to weewx-user
Hi All,
I'm trying to install WeeWX v4.1.0 on CentOS 8 and am running into dependency issues with '/usr/bin/python'.

# yum install weewx
Last metadata expiration check: 0:59:04 ago on Thu 28 May 2020 22:48:17 ACST.
Error:
 Problem: cannot install the best candidate for the job
  - nothing provides /usr/bin/python needed by weewx-4.1.0-1.el8.noarch
(try to add '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)

I understand that with CentOS 8 there is no package that provides '/usr/bin/python' anymore and there are separate commands to invoke either Python 2 (/usr/bin/python2) or Python 3 (/usr/bin/python3).
To be installable on CentOS 8 the rpm has to be changed to expect either /usr/bin/python2 or /usr/bin/python3.
I was hoping someone could fix the CentOS/RHEL 8 rpm so it works.

Thanks
David

Robert Beer

unread,
May 28, 2020, 12:52:06 PM5/28/20
to weewx-user
David,

Take a look at:

    alternatives --list

You can then set the Python version (3 in this example ):

    alternatives --set python /usr/bin/python3

This should get you going.

David

unread,
May 28, 2020, 7:16:47 PM5/28/20
to weewx-user
Hi Robert,
Thanks for the reply.
I have tried this but unfortunately it doesn't solve the problem.
While it provides a '/usr/bin/python' file, it doesn't solve the problem of providing a package which has the required dependency.

Regards
David

vince

unread,
May 28, 2020, 7:19:22 PM5/28/20
to weewx-user
On Thursday, May 28, 2020 at 4:16:47 PM UTC-7, David wrote:
Hi Robert,
Thanks for the reply.
I have tried this but unfortunately it doesn't solve the problem.
While it provides a '/usr/bin/python' file, it doesn't solve the problem of providing a package which has the required dependency.


So force the rpm installation to work around that part.  And yes.  Centos8 really hosed things up when they chose to have 'no' python interpreter. 

David

unread,
May 28, 2020, 7:47:51 PM5/28/20
to weewx-user
Hi Vince,
I could force the rpm installation, but was hoping to get the WeeWX rpm file fixed since this will be an ongoing issue.

Regards
David

vince

unread,
May 28, 2020, 8:54:30 PM5/28/20
to weewx-user
On Thursday, May 28, 2020 at 4:47:51 PM UTC-7, David wrote:
Hi Vince,
I could force the rpm installation, but was hoping to get the WeeWX rpm file fixed since this will be an ongoing issue.


Given people are all volunteers, you might be waiting a while for any particular fix in a packaged variant to be made available...

If you want to do it short-term, roll your own rpm with 'rpmbuild' from the sources and remove the dependency.   An alternate way would be to cook up a bogus rpm that 'provides /usr/bin/python' (but actually does nothing).  Install that manually and your rpmdb will have the dependency expectation met.  There's a tool called "fpm" that makes this pretty easy to do.

But if it's me, I'd just force the rpm to install and run the distributed version....

Tom Keffer

unread,
May 28, 2020, 9:58:59 PM5/28/20
to weewx-user
Could one of you two file an issue so we can track this? If we can't make a package that "just installs," there should be at least some documentation telling a user what to do.

-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/9e391add-0fc0-4181-91ef-25d422cb3cec%40googlegroups.com.

vince

unread,
May 28, 2020, 10:02:47 PM5/28/20
to weewx-user
Here is a quick rpm that should fake out things for you.  Try installing this first and then the weewx rpm for centos8.

These aren't digitally signed, so if rpm barks at you, 'use the force Luke' :-)

I've attached the spec file just so you can see what it has inside.  If you need to tweak it, edit the .spec file and run "rpmbuild -ba fake_python.spec" and install the resulting rpm.  If you have a minimal centos you might need to 'yum install rpm-build' to get the rpmbuild utility.   Give it a try.


fake_python.spec
fake_python-0.1-1.noarch.rpm

David

unread,
May 29, 2020, 4:40:28 AM5/29/20
to weewx-user
Thanks for that Vince, i'll give it a go and get back to you.
I understand people volunteer to do this stuff and certainly wasn't expecting an immediate fix.
My understanding is it should be a pretty simple one line change (maybe 2 if you include updating the rpm version) to fix so thought it could be rolled into the rpm when the next version of WeeWX is released.

--
David

mwall

unread,
May 29, 2020, 9:33:22 AM5/29/20
to weewx-user
vince,

the el8 rpm worked just fine for me when i tested on a centos8 system.

however, it is quite possible that my centos8 was not as much of a virgin as david's centos8

it should not matter whether we build the rpm packages on centos7 or centos8

the spec file defines these deps for el8:

%define deps python3, python3-setuptools, python3-configobj, python3-pillow, py\
thon3-pyserial, python3-pyusb

there is no 'python' dependency in there!

however, there *are* bld_deps that are python2:

%define bld_deps python, python-configobj

are these somehow getting propagated into the rpm itself?




On 28 May 2020, at 22:13, Tom Keffer = wrote:

As per Vince's request...
-tk

---------- Forwarded message ---------
From: vince
Date: Thu, May 28, 2020 at 7:06 PM
Subject: Private message regarding: [weewx-user] Re: Broken python dependency with CentOS 8
To: Tom Keffer



On Thursday, May 28, 2020 at 6:58:59 PM UTC-7, Tom Keffer wrote:
Could one of you two file an issue so we can track this? If we can't make a package that "just installs," there should be at least some documentation telling a user what to do.



If he doesn't do so, I'll get to it this week.

I took a pass at hacking on Matthew's spec file, but had an epic fail, so I cooked up a quick interim fake-it-out rpm for the user.

It looks from the spec file that he's building everything on centos7 which might be where things are getting whacko.  I built mine in a centos7 docker container just in case, but this is another one of those places where a bunch'o'containers might helps us work these kinds of os issues.  Worth a thought.

(if you can forward this to Matthew, I'd appreciate it - can't find a way to add a cc in reply-via-email in the google gui)

vince

unread,
May 29, 2020, 10:47:11 AM5/29/20
to weewx-user
On Friday, May 29, 2020 at 6:33:22 AM UTC-7, mwall wrote:
however, there *are* bld_deps that are python2:
%define bld_deps python, python-configobj
are these somehow getting propagated into the rpm itself?



If you run "rpm -qp --requires filename.rpm" you will see the dependencies that were built in.

I didn't get anywhere successfully in trying to bang on the spec file to tweak things.  I would agree that it shouldn't matter which version you build a .noarch.rpm on these days, in most cases.

What's interesting is it actually also requires 'perl' too.

[root@320c68ef1804 /]# rpm -qp --requires weewx-4.1.0-1.el8.noarch.rpm
warning: weewx-4.1.0-1.el8.noarch.rpm: Header V4 RSA/SHA1 Signature, key ID 15306a67: NOKEY
/bin/sh
/bin/sh
/bin/sh
/bin/sh
/usr/bin/env
/usr/bin/perl
/usr/bin/python 
config(weewx) = 4.1.0-1.el8
perl(strict)
python3
python3-configobj
python3-pillow
python3-pyserial
python3-pyusb
python3-setuptools
rpmlib(CompressedFileNames) <= 3.0.4-1
rpmlib(FileDigests) <= 4.6.0-1
rpmlib(PartialHardlinkSets) <= 4.0.4-1
rpmlib(PayloadFilesHavePrefix) <= 4.0-1
rpmlib(PayloadIsXz) <= 5.2-1

Provides looks ok:

[root@320c68ef1804 /]# rpm -qp --provides weewx-4.1.0-1.el8.noarch.rpm
warning: weewx-4.1.0-1.el8.noarch.rpm: Header V4 RSA/SHA1 Signature, key ID 15306a67: NOKEY
config(weewx) = 4.1.0-1.el8
weewx = 4.1.0-1.el8

There has to be some kind of macro expansion thing going on.  It's been so long since I had to dig into the internals that it's a little hazy how all this stuff works under the hood. 

vince

unread,
May 29, 2020, 12:24:14 PM5/29/20
to weewx-user
I'll open an issue on this one this afternoon and provide some updates there, if that's ok with Tom+Matthew...

mwall

unread,
May 29, 2020, 1:40:47 PM5/29/20
to weewx-user
On Friday, May 29, 2020 at 12:24:14 PM UTC-4, vince wrote:
I'll open an issue on this one this afternoon and provide some updates there, if that's ok with Tom+Matthew...

yes, please do.  i would like to get this fixed before the next release.
 

vince

unread,
May 29, 2020, 5:59:10 PM5/29/20
to weewx-user

vince

unread,
May 29, 2020, 6:12:13 PM5/29/20
to weewx-user
On Friday, May 29, 2020 at 1:40:28 AM UTC-7, David wrote:
On Friday, May 29, 2020 at 11:32:47 AM UTC+9:30, vince wrote:
Thanks for that Vince, i'll give it a go and get back to you.
I understand people volunteer to do this stuff and certainly wasn't expecting an immediate fix.


David - I 'did' verify that adding the bogus fake-python rpm that I posted 'does' work around the problem.  The official 4.1.0 weewx rpm installs ok afterward.  Tested in a centos-8 vagrant VM. 

vince

unread,
May 29, 2020, 6:45:18 PM5/29/20
to weewx-user
On Friday, May 29, 2020 at 10:40:47 AM UTC-7, mwall wrote:
Patch added to issue 564 comments - give it a try on both centos7 and centos8 variants of course.
Basically I switched to building the rpm under centos8 which seems to work ok for me. 

David

unread,
May 29, 2020, 10:00:10 PM5/29/20
to weewx-user
Hi Vince,
Can confirm the fake-python rpm worked for me as well. I tested it late last night.
Thanks
David
Reply all
Reply to author
Forward
0 new messages