Error: Problem: conflicting requests - nothing provides /usr/bin/python needed by python-chardet in CentOS 8
CentOS/RHEL 8 doesn't have any user-facing Python installed by default.
It has Python 3 installed for system apps like dnf
, but to use it as a user, you need sudo dnf install python3
.
Similarly, Python 2 and everything for it can be installed by using the appropriate package name suffix. To install Python 2 and the module you need:
sudo dnf install python2 python2-chardet
The recommendation/default is that the unversioned python
command should not work and you should invoke the desired Python version on the shell by typing python2
instead of python
.
If, for whatever reason you need unversioned python
command to invoke Python 2, use the alternatives system:
sudo alternatives --set python /usr/bin/python2
shreyas.k
Updated on June 14, 2022Comments
-
shreyas.k almost 2 years
I am using CentOS 8 and want to download a library for Python2.
CentOS 8 has Python3 and its libraries installed by default.
I want to download python-chardet library for Python2. So I tried to install it as below -
$ sudo yum install python-chardet
I got this error -
No match for argument: python-chardet Error: Unable to find a match: python-chardet
I searched for solution and as per this document you have to download its RPM binary and install it. https://centos.pkgs.org/7/centos-x86_64/python-chardet-2.2.1-3.el7.noarch.rpm.html
Downloading the binary file -
$ wget http://mirror.centos.org/centos/7/os/x86_64/Packages/python-chardet-2.2.1-3.el7.noarch.rpm
Using this rpm library I tried to install python-chardet as below -
$ sudo yum install ./python-chardet-2.2.1-3.el7.noarch.rpm
Here I got an error like this -
Error: Problem: conflicting requests - nothing provides /usr/bin/python needed by python-chardet-2.2.1-3.el7.noarch
Python version is
$ python -V
$ Python 2.7.16
/usr/bin/python returned this
Python 2.7.16 (default, Nov 17 2019, 00:07:27)
GCC 8.3.1 (RedHat) on linux2
Any help regarding this is much appreciated.
-
shreyas.k about 4 yearspython2-chardet can be installed as you said but i need to specifically install python-chardet library in CentOS 8..
-
Danila Vershinin about 4 yearsAs I have explained, it is the same thing. With suffix
-
dny238 over 3 yearsI read this over 2x and still can't get python-chardet installed. Are you suggesting to change the alternate python from 2 to 3? Neither work to allow python-chardet to install for me.
-
yolob 21 over 2 years@dny238 did you manage to solve this? I am encountering the same error
-
firasKoubaa about 2 yearsHave same problem , changing the alternative didn t fix it , did you manage how to install it ?
-
Danila Vershinin about 2 years@firasKoubaa as it was explained, you won't have any luck installing
python-chardet
because the equivalent package name in CentOS 8 is python*2*-chardet. Why do you insist on installing it with the obsolete namepython-chardet
and not with the correctpython2-chardet
?