我的CentOS盒子里安装了python2.6和python2.7。python2.6安装在/usr/bin/python
,我已经从源位置/usr/local/bin/python
安装了python2.7
安装后,我的默认python在/usr/bin
更改为python2.7而不是pythn2.6,我想在/usr/bin/python
使用python2.6。我已经试过做一些事情了,但都没有成功。
/usr/bin
请告诉我如何安装Python2.7、2.6和Python2.6作为默认版本。我也有同样的东西在我的ArchLinux系统中工作,但这不适用于我的centos系统。
附加我的.bashúu配置文件
# .bash_profile
export _BASH_PROFILE=1
# Get the aliases and functions
if [ -z "$_BASHRC" ]; then
. ~/.bashrc
fi
unset _BASH_PROFILE
# User specific environment and startup programs
PATH=$PATH:$HOME/bin
BASH_ENV=$HOME/.bashrc
USERNAME=""
export USERNAME BASH_ENV PATH
export user=$(/usr/bin/whoami)
export WK_PORT=8086
export WK_PATH=ADC
# For DEV accounts change PYDOC_PORT value to 7400 + webkit number. For
# example WK23 would be port number 7423
export PYDOC_PORT=7464
alias serve="python -m SimpleHTTPServer"
unset _BASH_PROFILE
# User specific environment and startup programs
PATH=$PATH:$HOME/bin
BASH_ENV=$HOME/.bashrc
USERNAME=""
export USERNAME BASH_ENV PATH
export user=$(/usr/bin/whoami)
export WK_PORT=8086
export WK_PATH=ADC
# For DEV accounts change PYDOC_PORT value to 7400 + webkit number. For
# example WK23 would be port number 7423
export PYDOC_PORT=7464
alias serve="python -m SimpleHTTPServer"
PYTHONPATH="$PYTHONPATH:/usr/bin/python"
可以使用alias将命令python指向2.6文件夹,将python27指向2.7,如下所示:
在.bash_配置文件中添加:
我也有同样的问题。下面的命令修复了它:
这将从
/usr/local/bin/python
-->;/usr/bin/python
生成一个符号链接。从here引用多亏了@brett beatty,我把
/usr/local/bin/python
符号链接指向了/usr/bin
。编译器查看/usr/local/bin
转到/usr/bin
,并使用正确的版本保持一致。相关问题 更多 >
编程相关推荐