Python3 want to develop in this environment, but the environment is CentOS6.5 default Python version 2.6.6.
Before practice is installed directly from source Python3, replace the existing development environment, but found that many script systems rely Python2.6, direct replacement will lead to a lot of software is not normal in the subsequent use.
Today found a friend to use Virtualenv Python3 development environment to build, here recorded, but also so that I can later reference.
Installation script as follows:
tar zxvf Python-3.4.3.tgz
./configure --prefix = / usr / local
make && make altinstall
After running the above command, you can see the new /usr/local/bin/python3.4 compilation environment in the directory.
Note: Here we are using make altinstall, if you use make install, you will see a system in two different versions of Python in / usr / bin / directory. This will cause a lot of problems, but also hard to deal with.
Development environment to build python3
1, the installation virtualenv, can pip install command is as follows:
pip install virtualenv
If you do not pip, through the following command to install:
yum install python-pip
2, create a virtual environment:
virtualenv -p /usr/local/bin/python3.4 py34env
After executing the above command, creates py34env folder in the current directory, the folder is a virtual environment we have created.
3, activate the virtual environment:
source py34env / bin / activate
3.1 ipython installed in a virtual environment
pip install ipython
3.2 ipython start in a virtual environment:
4, exit the virtual environment