简体   繁体   中英

Choose which version of python to use when installing with yum

I have 3 versions of Python on my Linux VPS (CentOS). Version 2.6 is the system python. I want to install modules to python 2.7 but running the following command just installs to python 2.6. How do I specify python 2.7 in this command?

yum install python-devel

Thanks!

You can set the default version of python using the "alternatives" system. Try

>> /usr/sbin/alternatives --configure python

If this has no effect, try to find the python version in use and modify the symlinks accordingly

>> which python

If the result, for example, is /usr/local/bin/python and the version of python you want to use is at /usr/bin/python2.7 then do

>> ln -sf /usr/bin/python2.7 /usr/local/bin/python

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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