简体   繁体   English

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

[英]How to install Python3 and GCC 7 in the same SCL shell?

I am trying to install graph-tool on a RHEL7 within a virtual environment;我正在尝试在虚拟环境中的 RHEL7 上安装图形工具 it uses both, Python 3 and gcc 7 or above.它同时使用 Python 3 和 gcc 7 或更高版本。 I am unable to use both of them within the same scl bash shell.我无法在同一个 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)

Is there a way to update gcc within the first environment ( rh-python36 )?有没有办法在第一个环境( rh-python36 )中更新 gcc ?

Thanks.谢谢。

I figured this out by following the below steps:我按照以下步骤解决了这个问题:

  1. enable the virtual environment containing the Python3启用包含 Python3 的虚拟环境
[root@ ~]# source /jupyter/bin/activate
(jupyter) [root@ ~]# which python
/jupyter/bin/python
(jupyter) [root@ ~]# python -V
Python 3.6.3
  1. enabled devtools afterwards:之后启用 devtools:
(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)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM