Python version upgrade and Pip deployment method

Source: Internet
Author: User
Tags install redis

python version upgrade

CentOS 6.3 comes with a python version of 2.6 and needs to be upgraded to version 2.7 first. Because older versions of Python are deeply dependent, you cannot uninstall the original Python, only the new installation.

1. Download python-2.7.4.tgz

wget http://python.org/ftp/python/2.7.4/Python-2.7.4.tgz

2. Unzip the installation, the command is as follows:

1 tar-xvf Python-2.7.4. tgz2 cd Python-2.7.43 ./configure--prefix=/usr/local/ python2.74make5 make install

3. Create a link to change the system default Python to python2.7

Ln-s/usr/local/python2.7/bin/python2.7/usr/bin/python

4. View the Python version

Python–v

5. Modify the Yum configuration (otherwise Yum will not work)

vim/usr/bin/Yum modifies the first line of #!/usr/bin/python to the original Python version address of the system #!/usr/bin/python2.6

This CentOS6.3 system Python has been successfully upgraded to 2.7.4 version

Install PIP

Pip is a tool for installing and managing Python packages.

The installation method is as follows:

1. Download Pip, address https://raw.github.com/pypa/pip/master/contrib/get-pip.py

2. Execute the Install command

Python get-pip.py

3. Create the connection (otherwise the error message "command does not exist")

Ln-s/usr/local/python2.7/bin/pip/usr/bin/pip

Test:

Pip Install Redis
Collecting Redis
/USR/LOCAL/PYTHON2.7/LIB/PYTHON2.7/SITE-PACKAGES/PIP/_VENDOR/REQUESTS/PACKAGES/URLLIB3/UTIL/SSL_.PY:90: Insecureplatformwarning:a true Sslcontext object is not available. This prevents URLLIB3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
Insecureplatformwarning
Downloading REDIS-2.10.5-PY2.PY3-NONE-ANY.WHL (60kB)
100% |################################| 61kB 759kb/s
Installing collected Packages:redis
Successfully installed redis-2.10.5

PIP installation is complete!

If you install the PIP times the following error: Importerror:cannot Import name Httpshandle

Execute yum Install Sqlite-devel

Python version upgrade and Pip deployment method

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.