python-3.x - 如何在同一个 SCL shell 中安装 Python3 和 GCC 7?
问题描述
我正在尝试在虚拟环境中的 RHEL7 上安装图形工具;它同时使用 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)
有没有办法在第一个环境(rh-python36
)中更新 gcc?
谢谢。
解决方案
我按照以下步骤解决了这个问题:
- 启用包含 Python3 的虚拟环境
[root@ ~]# source /jupyter/bin/activate
(jupyter) [root@ ~]# which python
/jupyter/bin/python
(jupyter) [root@ ~]# python -V
Python 3.6.3
- 之后启用 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)
推荐阅读
- r - Shiny-logs-error-没有名为“tidyverse”的包
- repository - 错误:“~linuxupprising”用户或团队不存在
- javascript - java中的selenium不能点击a href="javascript:void(0);"
- python - 如何删除 TensorFlow 自定义操作实例?
- postgresql - Postgres 内存不足
- javascript - Javascript && 和 || 运算符和内联三元函数产生 INSANE 结果
- r - 如何从两个向量中选择增加的值 - '编织两个向量'
- java - 如何在 java8 中使用 compareTo 对 LinkedLists 进行排序
- java - Hive selectExpression : ( 表达式 | tableAllColumns );])
- amazon-web-services - Alexa 技能控制台返回 null