【问题标题】:How to install python3-devel on red hat 7如何在红帽 7 上安装 python3-devel
【发布时间】:2017-08-20 05:05:56
【问题描述】:

我正在尝试在我的虚拟环境中安装一些东西,它使用 anaconda python 3.6。我收到the gcc failed with exit status 1,暗示缺少正确的python3-devel 包,如error: command 'gcc' failed with exit status 1 while installing eventlet 中所述。

为了修复错误,我尝试在运行 RHEL 7.3 的服务器上安装 python3-devel 包。 我做了yum install python3-devel,但得到了'package not found' 错误。然后我找到了https://serverfault.com/questions/710354/repository-for-python3-devel-on-centos-7,它暗示了EPEL存储库中的python34-devel包。我使用 yum 安装它,但尝试在我的虚拟环境中安装某些东西时,我仍然收到 the gcc failed with exit status 1 错误。

有人知道我该如何解决这个问题吗?非常感谢所有帮助。

【问题讨论】:

  • "gcc failed with exit status 1" 是症状,而不是原因。
  • 您好,谢谢您的回复。正如我在帖子中所描述的,我认为原因是缺少 python3-devel 包。
  • 好的,但问题中没有任何内容支持这一点。
  • 没错,添加了我的来源。
  • 作为旁注,我会推荐 Red Hat Software Collections 来安装 Python3 而不是 EPEL——你会得到官方的支持。见access.redhat.com/solutions/472793

标签: python-3.x installation virtualenv rhel7


【解决方案1】:

在 yum 中搜索包,使用如下命令:

yum search python3 | grep devel

它将列出所有可用的开发包。结果会有点像这样

python3-cairo-devel.x86_64 : Libraries and headers for python3-cairo
python3-devel.x86_64 : Libraries and header files needed for Python 3
                     : development
python34-devel.x86_64 : Libraries and header files needed for Python 3
                      : development

然后你可以从列表中选择你要安装的包,假设你要安装python3-devel,执行如下

yum install -y python3-devel.x86_64

【讨论】:

  • # yum search python3 // Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager // Warning: No matches found for: python3 No matches found -- 在我的系统上找不到它
  • 我想给你 2 分,但我不会让我...谢谢伙计...这是迄今为止最直接的答案
  • 以上对我不起作用,可能是因为我没有设置存储库,所以我在这里找到了这个工作:draculaservers.com/tutorials/install-python-3-centos-7 或者只是这个----------- ----------------------------- sudo yum install centos-release-scl sudo yum install rh-python36 scl enable rh-python36 bash python --版本
  • python3-devel 找到了哪个仓库?我配置了 base、extra、epel 和 ius,但没有找到。点子搜索找不到。我似乎只能在 rpmfind.net 上找到它,这是一个源 rpm。
【解决方案2】:

我想我可能会在 2020 年更新它。从 RHEL 7.7 开始,python-devel 在 EPEL 中不可用,它已被 Fedora Project 淘汰。我今天想要的只是 python h 文件,这让我到了那里:

# yum install python3-devel.x86_64 --enablerepo=rhel-7-server-optional-rpms

我们确实拥有 Redhat 免费开发人员许可证之一,但我不确定可选 rpm 是否需要它。

PS,这有助于验证哪些感兴趣的包在 optional-rpms 中

# yum repo-pkgs rhel-7-server-optional-rpms list | grep python3

【讨论】:

    【解决方案3】:

    在 Red Hat Enterprise Linux 6 或 7 中没有来自 Red Hat 的 python3-* 软件包。

    但是,如果您启用 第三方存储库(如 EPEL 或 IUS),则可以使用 python3-* 软件包。但是,Red Hat 不支持这些。如果您正在运行 RHEL,您的组织可能会偏好支持的软件包。

    您可以通过 Red Hat Software Collections (RHSCL) 从 Red Hat 获得受支持的 Python 3 软件包。目前 Python 3.6 是最新可用的,包名是 rh-python36。安装 RHSCL 包也会安装 rh-python36-devel 和其他一些包。

    How to install Python 3, pip, venv, virtualenv, and pipenv on RHEL

    别忘了先安装@development,所以你有 gcc、make 等来构建任何动态加载的共享对象。

    安装:

    $ su -
    # subscription-manager repos --enable rhel-7-server-optional-rpms \
      --enable rhel-server-rhscl-7-rpms
    # yum -y install @development
    # yum -y install rh-python36
    
    # yum -y install rh-python36-numpy \
     rh-python36-scipy \ 
     rh-python36-python-tools \
     rh-python36-python-six
    
    # exit
    

    上面链接的博客包含许多使用 Python、虚拟环境以及 Red Hat 上的软件集合的技巧。

    【讨论】:

      猜你喜欢
      • 2015-06-07
      • 2014-04-14
      • 2012-09-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-05-15
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多