gpt4 book ai didi

python - 在 CentOS 6.8 上安装 python 2.7.12 时出现问题-添加路径

转载 作者:行者123 更新时间:2023-12-04 19:37:22 24 4
gpt4 key购买 nike

已编辑
我试图在我的操作系统上安装 Python 2.7。
我使用了命令:

yum install -y python27

这是输出:
Loaded plugins: fastestmirror, refresh-packagekit, security
Setting up Install Process
Loading mirror speeds from cached hostfile
* base: ftp.hosteurope.de
* epel: repo.fedoralinux.ir
* extras: ftp.hosteurope.de
* updates: ftp.hosteurope.de
Package python27-1.1-25.el6.x86_64 already installed and latest version
Nothing to do

所以看起来它已经完成了。但我仍然看到以前的2.6版本。我应该将哪个地址添加到 .bashrc 中的路径文件
它是在 :
/opt/rh/python27/root/lib/modules
/opt/rh/python27/root/usr/include/python2.7/moduleobject.h
/opt/rh/python27/root/usr/include/python2.7/sysmodule.h
/opt/rh/python27/root/usr/lib/python2.7/site-packages/nose/plugins/allmodules.py
/opt/rh/python27/root/usr/lib/python2.7/site-packages/nose/plugins/allmodules.pyc
/opt/rh/python27/root/usr/lib/python2.7/site-packages/nose/plugins/allmodules.pyo
/opt/rh/python27/root/usr/lib/python2.7/site-packages/sphinx/ext/autosummary/templates/autosummary/module.rst
/opt/rh/python27/root/usr/lib64/pm-utils/module.d
/opt/rh/python27/root/usr/lib64/python2.7/modulefinder.py
/opt/rh/python27/root/usr/lib64/python2.7/modulefinder.pyc
/opt/rh/python27/root/usr/lib64/python2.7/modulefinder.pyo
/opt/rh/python27/root/usr/lib64/python2.7/lib-dynload/_bisectmodule.so
/opt/rh/python27/root/usr/lib64/python2.7/lib-dynload/_collectionsmodule.so
/opt/rh/python27/root/usr/lib64/python2.7/lib-dynload/_cryptmodule.so
/opt/rh/python27/root/usr/lib64/python2.7/lib-dynload/_functoolsmodule.so
/opt/rh/python27/root/usr/lib64/python2.7/lib-dynload/_localemodule.so
/opt/rh/python27/root/usr/lib64/python2.7/lib-dynload/_multibytecodecmodule.so
/opt/rh/python27/root/usr/lib64/python2.7/lib-dynload/_randommodule.so
/opt/rh/python27/root/usr/lib64/python2.7/lib-dynload/_socketmodule.so
/opt/rh/python27/root/usr/lib64/python2.7/lib-dynload/arraymodule.so
/opt/rh/python27/root/usr/lib64/python2.7/lib-dynload/cmathmodule.so
/opt/rh/python27/root/usr/lib64/python2.7/lib-dynload/dlmodule.so
/opt/rh/python27/root/usr/lib64/python2.7/lib-dynload/fcntlmodule.so
/opt/rh/python27/root/usr/lib64/python2.7/lib-dynload/gdbmmodule.so
/opt/rh/python27/root/usr/lib64/python2.7/lib-dynload/grpmodule.so
/opt/rh/python27/root/usr/lib64/python2.7/lib-dynload/itertoolsmodule.so
/opt/rh/python27/root/usr/lib64/python2.7/lib-dynload/mmapmodule.so
/opt/rh/python27/root/usr/lib64/python2.7/lib-dynload/nismodule.so
/opt/rh/python27/root/usr/lib64/python2.7/lib-dynload/parsermodule.so
/opt/rh/python27/root/usr/lib64/python2.7/lib-dynload/selectmodule.so
/opt/rh/python27/root/usr/lib64/python2.7/lib-dynload/spwdmodule.so
/opt/rh/python27/root/usr/lib64/python2.7/lib-dynload/stropmodule.so
/opt/rh/python27/root/usr/lib64/python2.7/lib-dynload/timemodule.so
/opt/rh/python27/root/usr/lib64/python2.7/lib-dynload/timingmodule.so
/opt/rh/python27/root/usr/lib64/python2.7/lib-dynload/zlibmodule.so

感谢您的任何评论或指导。

最佳答案

试试这个命令:

. /opt/rh/python27/enable

然后询问python版本:
python -V

它输出:

Python 2.7.8



现在要小心,只要您保持 session ,这将起作用。 IE。 : 一旦你退出你的 shell,你的环境变量就消失了。

关于python - 在 CentOS 6.8 上安装 python 2.7.12 时出现问题-添加路径,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41704574/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com