Python Programming Basic Environment installation

Source: Internet
Author: User

Installing 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

Solve problems that Yum can't use

Vim/usr/bin/yum
The first line #!/usr/bin/python replaced with the old version of Python #!/usr/bin/python2.4 note may be 2.6

PIP Module Installation

Yum Install Python-pip # CentOS installation 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 packages PIP Install requests
PIP Show–files Package # See what files are installed when installing packages
PIP Show–files Package # See which packages have updates
PIP Install–upgrade Package # Update a bundle
PIP Uninstall Package # Uninstall Packages

Python Programming Basic Environment installation

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.