Question

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!

Était-ce utile?

La solution

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
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top