CentOS Source Installation Python3.6

Source: Internet
Author: User

First, installation environment and version

CentOS 7
Python 3.6.5

Second, install the Dependency Pack 1, install the static library
# yum install -y openssl-static
Note: If you do not install this static library, it will cause the PIP installation of Python to fail 2, install GCC
# yum install -y gcc wget# yum groupinstall "Development tools"# yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel
Third, download and install PYTHON31, download Python3 installation package via official website
# wget http://python.org/ftp/python/3.6.5/Python-3.6.5.tar.xz
2. Unpack the installation package
# tar xf Python-3.6.5.tar.xz
3. Compile and install

Go to the Python-3.6.5 folder and edit the installation

# ./configure --prefix=/usr/local/python3# make & make install
Note:--prefix setting is python3 to install to the location four, add the file link (add to environment variable) 1, add the newly installed Python3 version of the file connection
# ln -s /usr/local/python3/bin/python3 /usr/bin/python3

View Python3 Version Information

# python3 -VPython 3.6.5
2. Add pip File connection

viewing PIP version Information

# python3 -m pip -Vpip 9.0.1 from /usr/local/lib/python3.6/site-packages (python 3.6)
Note: If the output hint does not have a PIP, then perform--five, PIP installation

Add a file connection for PIP

# ln -s /usr/local/python3/bin/pip3 /usr/bin/pip3

viewing PIP version Information

# pip3 -Vpip 9.0.3 from /usr/local/lib/python3.6/site-packages (python 3.6)
Five, PIP installation 1, install PIP

Download pip

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

Install PIP

# python3 get-pip.py

viewing PIP version Information

# python3 -m pip -Vpip 9.0.3 from /usr/local/lib/python3.6/site-packages (python 3.6)
2. Adding a PIP to an environment variable

Edit the/etc/profile document, add the following at the end, and save the exit.

export PATH="/usr/local/python3/bin:$PATH"

And then run

# source /etc/profile

viewing PIP version Information

# pip3 -Vpip 9.0.3 from /usr/local/lib/python3.6/site-packages (python 3.6)
At this point, all installations are complete!

CentOS Source Installation Python3.6

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.