Reference: http://www.linuxidc.com/Linux/2015-08/121352.htm
wget https://www.python.org/ftp/python/3.5.4/Python-3.5.4.tgz
Tar zxvf python-3.5.4.tgz
CD Python-3.5.4
./configure--prefix=/usr/local
Make && make Altinstall
Fatal Python error:Py_Initialize:Unable to get the locale Encodinglookuperror:unknown encoding:gb180 if you make an error while executing make 30 Modify the Langexport LANG =zh_cn first. UTF-8export LANGUAGE=zh_cn. UTF-8
After running the above command, you can see the newly compiled environment in the directory/usr/local/bin/python3.5.
Note: Here we are using make altinstall, and if you use makes install, you will see that there are two different versions of Python in the system in the/usr/bin/directory. This will lead to a lot of problems and is not easy to handle.
Build PYTHON3 development environment
1, install VIRTUALENV, can be installed through PIP, the command is as follows:
Pip Install Virtualenv
If PIP is not installed, you can install it by using the following command:
Yum Install Python-pip
2. Create a virtual environment:
Virtualenv-p/usr/local/bin/python3.5 py35env
Note: If you are prompted not to find virtualenv then use the full path to execute >>find/-name virtualenv/usr/local/python27/bin/virtualenv
After executing the above command, the Py35env folder is created in the current directory, which is the virtual environment that we created.
3. Activating the Virtual environment:
SOURCE Py35env/bin/activate
3.1. Installing Ipython in a virtual environment
Pip Install Ipython
3.2. Start the Ipython in a virtual environment:
Ipython
4. Exit the virtual environment
Deactivate
"Linux" centos6.9 install python3.5 through virtualenv