Python installation detailed

Source: Internet
Author: User

Linux Yum relies on its own python, to prevent errors, the update here is actually to install a python


View the default Python version

Python-v


First, to resolve the dependency relationship:

# yum-y Install Readline-devel [when interacting, you can have Python's own delete function]



1, install GCC, for compiling python source code

Yum Install GCC

2, download the source package, https://www.python.org/ftp/python/

3. Unzip and enter the source file

4. Compile and install

./configure

Make all

Make install

5. View version

/usr/local/bin/python2.7-v

6. Modify the default Python version

mv/usr/bin/python/usr/bin/python2.6

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

7. To prevent Yum from performing exceptions, modify the Python version used by Yum

Vi/usr/bin/yum

Change the head #!/usr/bin/python to #!/usr/bin/python2.6




# # #下载最新版的pip, then install

wget https://bootstrap.pypa.io/get-pip.py

Python get-pip.py


Find the location of the PIP

Whereis pip


Find the path to the pip2.7 and create a soft chain for it as the default startup version of the system

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


Step three: Pip installation complete, install Scrapy test

Pip Install Scrapy



# # #zlib安装

VI./modules/setup

Find #zlib zlibmodule.c-i$ (prefix)/include-l$ (exec_prefix)/lib-lz Remove comments and save, then compile and install




Second, configure the PIP source

# # #pip源

sudo easy_install-i http://pypi.douban.com/simple/saltTesting

sudo pip install-i http://pypi.douban.com/simple/saltTesting


Vim/etc/pip.conf

[Global]

Index-url = http://pypi.douban.com/simple/

Trusted-host = pypi.douban.com


###

Specify Source #pip Install

#配置文件中设置源



#pip the Install command to specify the source

#pip install-i [Source Address] Package_name

For example: Pip install-i http://pypi.douban.com/simple/pymongo--trusted-host pypi.douban.com Specifies to download the Pymongo library from the watercress source and install




#配置文件中设置源

Create the ~/.pip/directory (not required if it exists)

Create the ~/.pip/pip.conf file and modify the contents of the file as follows (example modified to watercress source)

[Global]

Timeout=40

Index-url= http://pypi.douban.com/simple/

[Install]

trusted-host=

Pypi.douban.com




Third, installation Ipython

# Tar XF ipython-1.2.1.tar.gz

# CD IPYTHON-1.2.1/

#/usr/local/python27/bin/python2.7 setup.py Build

#/usr/local/python27/bin/python2.7 setup.py Install




This article is from "Meteor Studio" blog, please make sure to keep this source http://redone.blog.51cto.com/5382451/1923029

Python installation detailed

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.