Install python in linux and pip and linuxpythonpip

Source: Internet
Author: User
Tags install openssl

Install python in linux and pip and linuxpythonpip

I tried to install python in a linux environment recently, but the installation of python and pip on the Internet is a bit confusing, so today I will summarize the experience of my predecessors and hope to help you.

 

Download python source code package:

Https://www.python.org/downloads/

 

When installing python, ImportError: cannot import name HTTPSHandler ImportError: No module named setuptools may cause problems, prevent the above problems from occurring. yum-y install zlib-devel yum install gcc-c ++ install the required compiler yum install openssl-y yum install openssl-devel- y unzip and install python tar-zxvf Python-2.7.13.tgz cd Python-2.7.13. /configure -- prefix =/usr/local/Python2.7 make & make install update compiler rm/usr/bin/python ln-s/usr/lo Cal/Python2.7/bin/python/usr/bin/python vim/usr/bin/yum first line modified #! /Usr/bin/python2.6 create a library file and refresh the library file. solution 1: cd/etc/ld. so. conf. d/vim python2.7.conf/usr/local/Python2.7/lib ldconfig solution 2: cd/etc/ld. so. conf. d/echo '/usr/local/Python2.7/lib'> python2.7.conf install setuptools to facilitate pip installation later # wget https://pypi.python.org/packages/source/s/setuptools/setuptools-2.0.tar.gz -- no-check-certificate # tar zxvf setuptools-2.0.tar.gz # cd setuptools-2.0 # python setup. py build # python setup. py install pip # wget "https://pypi.python.org/packages/source/p/pip/pip-1.5.4.tar.gz#md5=834b2904f92d46aaa333267fb1c922bb" -- no-check-certificate # tar-xzvf pip-1.5.4.tar.gz # cd pip-1.5.4 # python setup. py install

Install and test pip
Pip install nose

 

 

Refer to blog:

Http://blog.csdn.net/u013372487/article/details/51726002

Http://blog.csdn.net/yabingshi_tech/article/details/50439142

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.