这是 python36 版本问题吗?如何解决?
Is this python36 version issue? How to resolve it?
我在使用 RHEL。我按照 https://www.rosehosting.com/blog/how-to-install-python-3-6-4-on-centos-7/ 安装了 python。尝试安装 requests-kerberos
时出现错误
pip3 install requests-kerberos
returns
src/kerberos.c:17:20: fatal error: Python.h: No such file or directory
#include <Python.h>
^
compilation terminated.
error: command 'gcc' failed with exit status 1
sudo yum 安装 gcc
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager
Package gcc-4.8.5-39.el7.x86_64 already installed and latest version
Nothing to do
然后我试了
sudo yum install python3-devel
得到了
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager
No package python3-devel available.
Error: Nothing to do
然后我试了
sudo yum install python36-devel
得到了
Error: Package: python36-devel-3.6.8-2.el7.ius.x86_64 (ius)
Requires: python36 = 3.6.8-2.el7.ius
Installed: python3-3.6.8-10.el7.x86_64 (@rhel-7-server-rpms)
python36 = 3.6.8-10.el7
Available: python36-3.6.8-2.el7.ius.x86_64 (ius)
python36 = 3.6.8-2.el7.ius
Error: Package: python36-devel-3.6.8-2.el7.ius.x86_64 (ius)
Requires: python36-libs(x86-64) = 3.6.8-2.el7.ius
Installed: python3-libs-3.6.8-10.el7.x86_64 (@rhel-7-server-rpms)
python36-libs(x86-64) = 3.6.8-10.el7
Available: python36-libs-3.6.8-2.el7.ius.x86_64 (ius)
python36-libs(x86-64) = 3.6.8-2.el7.ius
您正在使用 RHEL,但您关注了一个随机的 Centos 博客 post。以下是 Red Hat Developers Blog:
在 Centos 和 RHEL(6 或 7)上更好地 python36 的一些建议摘要
启用SCL
软件集是 RedHat Satellite 存储库,如果您的服务器是气隙的,即没有互联网,它也可以工作。
在 Centos 上:
yum 安装 centos-release-scl
在 RHEL7 上
yum-config-manager --enable rhel-server-rhscl-7-rpms
安装主SCL包:
yum 安装 rh-python36
开始使用您刚安装的软件集:
scl 启用 rh-python36bash
用自身升级pip3,更新setuptools:
pip3 安装 --upgrade pip
pip3 安装 --upgrade setuptools
安装requests-kerberos:
pip3 安装请求-kerberos
备注:
- 等同于bash获取文件
/opt/rh/rh-python36/enable
- 安装主软件包就足够了:
我在使用 RHEL。我按照 https://www.rosehosting.com/blog/how-to-install-python-3-6-4-on-centos-7/ 安装了 python。尝试安装 requests-kerberos
时出现错误pip3 install requests-kerberos
returns
src/kerberos.c:17:20: fatal error: Python.h: No such file or directory
#include <Python.h>
^
compilation terminated.
error: command 'gcc' failed with exit status 1
sudo yum 安装 gcc
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager
Package gcc-4.8.5-39.el7.x86_64 already installed and latest version
Nothing to do
然后我试了
sudo yum install python3-devel
得到了
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager
No package python3-devel available.
Error: Nothing to do
然后我试了
sudo yum install python36-devel
得到了
Error: Package: python36-devel-3.6.8-2.el7.ius.x86_64 (ius)
Requires: python36 = 3.6.8-2.el7.ius
Installed: python3-3.6.8-10.el7.x86_64 (@rhel-7-server-rpms)
python36 = 3.6.8-10.el7
Available: python36-3.6.8-2.el7.ius.x86_64 (ius)
python36 = 3.6.8-2.el7.ius
Error: Package: python36-devel-3.6.8-2.el7.ius.x86_64 (ius)
Requires: python36-libs(x86-64) = 3.6.8-2.el7.ius
Installed: python3-libs-3.6.8-10.el7.x86_64 (@rhel-7-server-rpms)
python36-libs(x86-64) = 3.6.8-10.el7
Available: python36-libs-3.6.8-2.el7.ius.x86_64 (ius)
python36-libs(x86-64) = 3.6.8-2.el7.ius
您正在使用 RHEL,但您关注了一个随机的 Centos 博客 post。以下是 Red Hat Developers Blog:
在 Centos 和 RHEL(6 或 7)上更好地 python36 的一些建议摘要启用SCL
软件集是 RedHat Satellite 存储库,如果您的服务器是气隙的,即没有互联网,它也可以工作。
在 Centos 上:
yum 安装 centos-release-scl
在 RHEL7 上
yum-config-manager --enable rhel-server-rhscl-7-rpms
安装主SCL包:
yum 安装 rh-python36
开始使用您刚安装的软件集:
scl 启用 rh-python36bash
用自身升级pip3,更新setuptools:
pip3 安装 --upgrade pip
pip3 安装 --upgrade setuptools
安装requests-kerberos:
pip3 安装请求-kerberos
备注:
- 等同于bash获取文件
/opt/rh/rh-python36/enable
- 等同于bash获取文件
- 安装主软件包就足够了: