Error: Problem: conflicting requests - nothing provides /usr/bin/python needed by python-chardet in CentOS 8
Error: Problem: conflicting requests - nothing provides /usr/bin/python needed by python-chardet in CentOS 8
我正在使用 CentOS 8 并想为 Python2 下载一个库。
CentOS 8 默认安装 Python3 及其库。
我想为 Python2 下载 python-chardet 库。所以我尝试按如下方式安装它 -
$ sudo yum install python-chardet
我收到这个错误 -
No match for argument: python-chardet
Error: Unable to find a match: python-chardet
我搜索了解决方案,根据此文档,您必须下载其 RPM 二进制文件并进行安装。 https://centos.pkgs.org/7/centos-x86_64/python-chardet-2.2.1-3.el7.noarch.rpm.html
正在下载二进制文件 -
$ wget http://mirror.centos.org/centos/7/os/x86_64/Packages/python-chardet-2.2.1-3.el7.noarch.rpm
我尝试使用这个 rpm 库安装 python-chardet,如下所示 -
$ sudo yum install ./python-chardet-2.2.1-3.el7.noarch.rpm
这里我遇到了这样的错误-
Error:
Problem: conflicting requests
- nothing provides /usr/bin/python needed by python-chardet-2.2.1-3.el7.noarch
Python版本为
$ python -V
$ Python 2.7.16
/usr/bin/python 返回了这个
Python 2.7.16 (default, Nov 17 2019, 00:07:27)
GCC 8.3.1 (RedHat) on linux2
非常感谢有关此的任何帮助。
CentOS/RHEL 8 默认没有安装任何面向用户的 Python。
它已为 dnf
等系统应用程序安装了 Python 3,但要以用户身份使用它,您需要 sudo dnf install python3
。
类似地,Python 2 和它的所有内容都可以通过使用适当的包名称后缀来安装。要安装 Python 2 和您需要的模块:
sudo dnf install python2 python2-chardet
recommendation/default 是未版本化的 python
命令应该不起作用,您应该通过键入 python2
在 shell 上调用所需的 Python 版本而不是 python
.
如果出于某种原因需要未版本化的 python
命令来调用 Python 2,请使用替代系统:
sudo alternatives --set python /usr/bin/python2
我正在使用 CentOS 8 并想为 Python2 下载一个库。
CentOS 8 默认安装 Python3 及其库。
我想为 Python2 下载 python-chardet 库。所以我尝试按如下方式安装它 -
$ sudo yum install python-chardet
我收到这个错误 -
No match for argument: python-chardet
Error: Unable to find a match: python-chardet
我搜索了解决方案,根据此文档,您必须下载其 RPM 二进制文件并进行安装。 https://centos.pkgs.org/7/centos-x86_64/python-chardet-2.2.1-3.el7.noarch.rpm.html
正在下载二进制文件 -
$ wget http://mirror.centos.org/centos/7/os/x86_64/Packages/python-chardet-2.2.1-3.el7.noarch.rpm
我尝试使用这个 rpm 库安装 python-chardet,如下所示 -
$ sudo yum install ./python-chardet-2.2.1-3.el7.noarch.rpm
这里我遇到了这样的错误-
Error:
Problem: conflicting requests
- nothing provides /usr/bin/python needed by python-chardet-2.2.1-3.el7.noarch
Python版本为
$ python -V
$ Python 2.7.16
/usr/bin/python 返回了这个
Python 2.7.16 (default, Nov 17 2019, 00:07:27)
GCC 8.3.1 (RedHat) on linux2
非常感谢有关此的任何帮助。
CentOS/RHEL 8 默认没有安装任何面向用户的 Python。
它已为 dnf
等系统应用程序安装了 Python 3,但要以用户身份使用它,您需要 sudo dnf install python3
。
类似地,Python 2 和它的所有内容都可以通过使用适当的包名称后缀来安装。要安装 Python 2 和您需要的模块:
sudo dnf install python2 python2-chardet
recommendation/default 是未版本化的 python
命令应该不起作用,您应该通过键入 python2
在 shell 上调用所需的 Python 版本而不是 python
.
如果出于某种原因需要未版本化的 python
命令来调用 Python 2,请使用替代系统:
sudo alternatives --set python /usr/bin/python2