Install Python 3.5.2 In CentOS 6.5 (coexist with Python2) and centospython2
This article describes how to install Python 3.5.2 In CentOS 6.5 and coexist with Python 2. For more information, see the following:
The installation procedure is as follows:
1. Prepare the compiling environment. (if the environment is incorrect, you may encounter various problems. For example, wget cannot download files connected to https)
yum groupinstall 'Development Tools'yum install zlib-devel bzip2-devel openssl-devel ncurses-devel
2. Download The Python3.5 code package
wget https://www.python.org/ftp/python/3.5.2/Python-3.5.2.tar.xz
3. Compile
tar Jxvf Python-3.5.2.tar.xzcd Python-3.5.2./configure --prefix=/usr/local/python3make && make install
4. Set Environment Variables
echo 'export PATH=$PATH:/usr/local/python3/bin' >> ~/.bashrc
5. Set the Directory
ln -sv /usr/local/python3/bin/python3.5 /usr/bin/python3
The purpose is to input python3 in any directory of the system to call the python3.5 command.
Install pip
Pip is installed based on the wiki on the official website.
1. Install setuptools. Install setuptools before installing pip, as shown on the above page.
Download and execute:
wget https://pypi.python.org/packages/source/s/setuptools/setuptools-5.7.zip --no-check-certificateunzip setuptools-5.7.zip cd setuptools-5.7python3 setup.py install
wget wget https://pypi.python.org/packages/source/p/pip/pip-7.1.2.tar.gz#md5=3823d2343d9f3aaab21cf9c917710196tar xvf pip-7.1.2.tar.gzcd pip-7.1.2python3 setup.py install
After installation, you can.
Summary
Well, let's talk about it first. The above is all the content of this article. I hope the content of this article will help you in your study or work. If you have any questions, please leave a message, thank you for your support.