regular python needed for RPM package to install

Latest response

I'm a DoD contractor trying to install s/w which is a .rpm file. When trying to run the program I get the following message. Failed dependencies:
/usr/bin/python is needed by acas_configure-19.03-1.noarch.

I don't see the regular version of python on RHEL 8.x. When I run python -V i get the command not found, but when I run python2 -V i get Python 2.7.16. Any help on this matter would be greatly appreciated.

Responses

Hi Nathaniel,

RHEL 8 ships with Python 3.6 and 2.7 ... both being provided as modules.

$ sudo dnf module list --enabled | grep python
python27             2.7 [d][e]    common [d]        Python programming language, version 2.7            
python36             3.6 [d][e]    common [d], build Python programming language, version 3.6  

Select which one you want to use with the alternatives command ... :)

$ python -V
bash: python: command not found...

$ sudo alternatives --config python

There are 3 programs which provide 'python'.

  Selection    Command
-----------------------------------------------
*+ 1           /usr/libexec/no-python
   2           /usr/bin/python3
   3           /usr/bin/python2

Enter to keep the current selection[+], or type selection number: 2  

$ python -V
Python 3.6.8  

Regards,
Christian

I was able to run the alternative command and selected both options 2 & 3. Neither seems to be working. I still get the same message when try to run the rpm command. Side note.. How do you upload screen shots into this forum?

Hi Nathaniel,

No idea why your program doesn't run - but it looks as if there are not matching dependencies involved. Best
would be to ask the application vendor. And screenshots can only be added (uploaded) in the original post. :)

Regards,
Christian

Hi Nathaniel,

Some additional information ... default version of python on RHEL 8 is 3.6 - there are only some basic packages of python 2.7
installed. If you want to use (old) python 2.7, you may have to install additional packages. You can check what is installed with :
sudo dnf list installed | grep python ... Bear in mind that python 2 is "on the way out", so better choose python 3. :)

Regards,
Christian

Hi Nathaniel,

I see that Christian has already provided enough information.

If you've set alternatives then running "python -V" should actually shows supported/configured python version. As you've mentioned in your initial statement:

When I run python -V i get the command not found, but when I run python2 -V i get Python 2.7.16.

Please get this configured first ( alternatives --set python /usr/bin/python3) and then run the command "python -V" and it should work. Also, use the "yum" command to install packages so that it would pull the dependencies automatically.

All, To my knowledge I have install python2 & python3.x. When I run python -V now I'm getting Python 3.6.8 now after running the (alternatives --set python /usr/bin/python3). I still get the following message. Failed dependencies: /usr/bin/python is needed by acas_confogure-19.03-1.noarch. A little back story.. I initially install the minimal. Then did a yum install/upgrade and added the graphical module as well. Could I still be missing something or is the .rpm packages just not compatible with RHEL 8.x

Yes, that is seems to be right. Check with application vendor to see if it is supported or compatible with RHEL8.x release. Also, please post the complete error message that you get when running 'yum install' command. Please remember to add the ~~~ as the header & footer of that message for clear indentation and readability. Otherwise, view the Formatting Help at the bottom right corner of your window to know more about it.

Below are a series of steps that have been posted in this forum. The error message is listed on the very last line of the screenshots...

[root@localhost acas]# python -V Python 2.7.16 [root@localhost acas]# sudo dnf module list --enabled | grep python python27 2.7 [d][e] common [d] Python programming language, version 2.7
python36 3.6 [d][e] common [d], build Python programming language, version 3.6
[root@localhost acas]#

[root@localhost acas]# python -V Python 2.7.16 [root@localhost acas]# sudo dnf module list --enabled | grep python python27 2.7 [d][e] common [d] Python programming language, version 2.7
python36 3.6 [d][e] common [d], build Python programming language, version 3.6
[root@localhost acas]#

[root@localhost acas]# python -V Python 2.7.16

<

pre>[root@localhost acas]# python -V Python 3.6.8

[root@localhost acas]# rpm -ivh CM-239743-acas_configure-19.03-1.noarch.rpm error: Failed dependencies: /usr/bin/python is needed by acas_configure-19.03-1.noarch [root@localhost acas]#

You may run the command "rpm -ivvh" to get debug output to see further about error/warnings when executing the command. Otherwise, this should generally work since /usr/bin/python is symbolic linked to python3. May be that the package is designed in such a way that it is looking out for a binary file /usr/bin/python, which is not there. And the one present now is a symbolic link file. If this is the case, then the application could be a legacy one and may not be compatible with RHEL8. Please check with vendor. Have you tried executing the 'yum install' command? I'm sure this might also show up the same error message.

see below suing the 'yum install' command

[root@localhost acas]# yum install CM-239743-acas_configure-19.03-1.noarch.rpm Updating Subscription Management repositories. Last metadata expiration check: 1:00:03 ago on Wed 25 Mar 2020 02:54:55 PM EDT. Error: Problem: conflicting requests - nothing provides /usr/bin/python needed by acas_configure-19.03-1.noarch (try to add '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages) [root@localhost acas]#

This may be more readable...

[root@localhost acas]# yum install CM-239743-acas_configure-19.03-1.noarch.rpm
Updating Subscription Management repositories.
Last metadata expiration check: 1:00:03 ago on Wed 25 Mar 2020 02:54:55 PM EDT.
Error: 
 Problem: conflicting requests
  - nothing provides /usr/bin/python needed by acas_configure-19.03-1.noarch
(try to add '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)
[root@localhost acas]# 

I would double check and make sure the scanner rpm is compatible with EL8. I haven't checked in almost a year now but last I saw the Nessus download only supported versions 6 and 7.

Cool. I will double check w/ the OEM about this and continue to T/S this issues as well.

In Fedora 30, the /usr/bin/python binary is provided by the package python-unversioned-command, and one can always try building this package on RHEL 8 using the Fedora source: python2-2.7.17-1.fc30.src.rpm.

Note that this yield Python 2.7, which is end-of-life. For Python 3.7, use the Fedora 31 source.

Hi Nathaniel, I'm maybe a bit late to the party. I just wanted to mention that the use of Python with RHEL 8 is described in this piece of Red Hat documentation: https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/configuring_basic_system_settings/using-python3_configuring-basic-system-settings

I am using CentOS8.1 AARCH64, python 2 and Python 3 coexist in my environment. When trying to run "rmp-ivh argcomplete" I get the following message. Failed dependencies: "/usr/bin/ Python is needed by argcomplete", how to solve this problem?