Linux under the Python environment installation configuration steps

Source: Internet
Author: User

Install python2.7

wget https://www.Python.org/ftp/Python/2.7.8/Python-2.7.8.tgz

Tar xvf python-2.7.8.tgz
CD Python-2.7.8
./configure–prefix=/usr/local/python27
Make
Make install
Mv/usr/bin/python/usr/bin/python_old
Ln-s/usr/local/python27/bin/python/usr/bin/
Python # View version

Troubleshoot problems that Yum cannot use

Vim/usr/bin/yum
First line #!/usr/bin/python Replace with old version Python #!/usr/bin/python2.4 note may be 2.6

PIP Module Installation

Yum Install Python-pip # CentOS mount Pip
sudo apt-get install Python-pip # Ubuntu installation pip

PIP Official Installation Script

wget https://raw.github.com/pypa/pip/master/contrib/get-pip.py
Python get-pip.py

PIP compilation Installation

wget http://pypi.python.org/packages/source/s/setuptools/setuptools-0.6c11.tar.gz
Tar zxvf setuptools-0.6c11.tar.gz
CD SETUPTOOLS-0.6C11
Python setup.py Build
Python setup.py Install
wget https://pypi.python.org/packages/source/p/pip/pip-1.5.6.tar.gz#md5=01026f87978932060cc86c1dc527903e
Tar zxvf pip-1.5.6.tar.gz
CD pip-1.5.6
Python setup.py Build
Python setup.py Install

Load Environment variables

Vim/etc/profile
Export Path=/usr/local/python27/bin: $PATH
. /etc/profile

Pip Install Package # Install package pip install requests
Pip Show–files Package # See which files are installed when the package is installed
Pip Show–files Package # See which packages have updates
Pip Install–upgrade Package # Update a package
Pip Uninstall Package # Uninstall Package

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.