如何在同一个SCL shell中安装Python3和GCC 7?

问题描述 投票:0回答:1

我正在尝试在虚拟环境中的 RHEL7 上安装 graph-tool;它同时使用 Python 3 和 gcc 7 或更高版本。 我无法在同一个 scl bash shell 中使用它们。

[root@ ~]# scl enable rh-python36 bash
[root@ ~]# python -V
Python 3.6.3
[root@ ~]# gcc --version | grep gcc
gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-44)
[root@ ~]# exit
exit
[root@ ~]# scl enable devtoolset-7 bash
[root@ ~]# python -V
Python 2.7.5
[root@ ~]# gcc --version | grep gcc
gcc (GCC) 7.3.1 20180303 (Red Hat 7.3.1-5)

有没有办法在第一个环境中更新gcc(

rh-python36
)?

谢谢。

python-3.x linux gcc rhel7 devtoolset
1个回答
0
投票

我通过以下步骤解决了这个问题:

  1. 启用包含Python3的虚拟环境
[root@ ~]# source /jupyter/bin/activate
(jupyter) [root@ ~]# which python
/jupyter/bin/python
(jupyter) [root@ ~]# python -V
Python 3.6.3
  1. 随后启用开发工具:
(jupyter) [root@ ~]# scl enable devtoolset-7 'bash'
[root@ ~]# python -V
Python 3.6.3
[root@ ~]# gcc --version
gcc (GCC) 7.3.1 20180303 (Red Hat 7.3.1-5)
© www.soinside.com 2019 - 2024. All rights reserved.