Centos sudo command execution python differs from normal user execution of Python version

Source: Internet
Author: User

Some time ago, the Python2.6 CentOS 6.5 virtual machine was upgraded to Python 2.7 and installed Pip by the way. http://blog.csdn.net/jcjc918/article/details/11022345

However, after discovering the package that was subsequently installed via PIP, the module was not found in Python using the import command, and the PIP was installed under the Python 2.6 folder.

Since the sudo command is still python 2.6, the sudo command sudo python setup.py install PIP is installed under the PIP installation folder, and it will install to the python2.6 folder by default. Workaround: Use the Sudo-i python setup.py install installation, which will be addressed to python2.7, or directly to the location of the python2.7 to successfully install. Similarly, when using PIP installation, you should also use the Sudo-i command to perform pip install

For instructions on how Sudo will address the python2.6, refer to the Http://stackoverflow.com/questions/15441440/sudo-python-runs-old-python-version

Centos sudo command execution python differs from normal user execution of Python version

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.