Python environment and python Environment

Source: Internet
Author: User

Python environment and python Environment


Introduction:

Record the installation steps for the Python environment Software Package

1. Upgrade Python to 2.7.10 (2.6.6 by default)

shell > yum -y install epel-releaseshell > yum -y install gcc wget readline-devel zlib-devel openssl-develshell > wget https://www.python.org/ftp/python/2.7.10/Python-2.7.10.tgzshell > tar zxf Python-2.7.10.tgzshell > cd Python-2.7.10 ; ./configure --prefix=/usr/local/python2.7 ; make ; make installshell > mv /usr/bin/python /usr/bin/old_pythonshell > ln -s /usr/local/python2.7/bin/python /usr/bin/pythonshell > sed -i '1s/python/old_python/' /usr/bin/yumshell > python -VPython 2.7.10

# Python upgrade
# The readline-devel package must be installed in advance. Otherwise, ipython does not support tabs, direction keys, and so on. You must re-compile python.
# The zlib-devel package Setuptools will be used, and the openssl-devel package pip will use
# Modify the/usr/bin/yum file interpreter. Otherwise, yum cannot be used.

2. Install Setuptools

shell > wget https://pypi.python.org/packages/source/s/setuptools/setuptools-15.2.tar.gz#md5=a9028a9794fc7ae02320d32e2d7e12eeshell > tar zxf setuptools-15.2.tar.gzshell > cd setuptools-15.2 ; python setup.py installshell > ln -s /usr/local/python2.7/bin/easy_install /usr/bin/easy_install

# In this way, Setuptools is also installed. If you do not install this package, directly download the pip source package and install it. An error may be reported, indicating that Setuptools cannot be found.

3. Install pip

shell > wget https://pypi.python.org/packages/source/p/pip/pip-6.1.1.tar.gz#md5=6b19e0a934d982a5a4b798e957cb6d45shell > tar zxf pip-6.1.1.tar.gzshell > cd pip-6.1.1 ; python setup.py installshell > ln -s /usr/local/python2.7/bin/pip /usr/bin/pip

# Pip has been installed. Of course, with easy_install, you can directly install pip. The source code is just another installation method.

4. Install ipython

shell > wget https://pypi.python.org/packages/source/i/ipython/ipython-3.1.0.tar.gz#md5=a749d90c16068687b0ec45a27e72ef8fshell > tar zxf ipython-3.1.0.tar.gzshell > cd ipython-3.1.0 ; python setup.py installshell > ln -s /usr/local/python2.7/bin/ipython /usr/bin/ipython

# In this way, ipython has been installed. You can also use pip install ipython to quickly install ipython.

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.