Install the following on CentOS 6.6.
# :Run as root.
$ :General user(Other than root)Run with.
Python3.4 This time, build from source and install.
First is the installation of related modules.
# yum groupinstall "Development tools"
# yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel
Download the source and configure → make → make alt install.
# cd /usr/local/src
# wget https://www.python.org/ftp/python/3.4.3/Python-3.4.3.tgz
# tar -zxvf Python-3.4.3.tgz
# cd Python-3.4.3
# ./configure --prefix=/usr/local/python
# make && make altinstall
Make the python library visible to the entire system.
# echo "/usr/local/python/lib" >> /etc/ld.so.conf
# ldconfig
Paste the installed python3.4 link under / usr / local / bin / that is in your PATH.
# ln -s /usr/local/python/bin/python3.4 /usr/local/bin/python
Set the PATH value so that / usr / local / bin comes first.
You should be able to call python3.4 with python.
# /usr/local/python/bin/python3.4 -V
# python -V
If the above results are the same, the installation is successful.
Easy_Install Easy_Install will put pip, so install it.
# cd /usr/local/src
# wget https://pypi.python.org/…/s/setuptools/setuptools-18.0.1.zip
# unzip setuptools-18.0.1.zip
# cd setuptools-18.0.1
# /usr/local/bin/python setup.py install
# ln -s /usr/local/python/bin/easy_install /usr/local/bin/easy_install
Pip
# /usr/local/bin/easy_install pip
# ln -s /usr/local/python/bin/pip /usr/local/bin/pip
Virtualenv A library for creating a virtual environment for python.
# pip install virtualenv
# ln -s /usr/local/python/bin/virtualenv /usr/local/bin/virtualenv
Virtualenvwrapper This is an extension that collectively manages the virtual environment of virtualenv.
# pip install virtualenvwrapper
Settings are required for each user.
$ vim ~/.bashrc
if [ -f /usr/local/python/bin/virtualenvwrapper.sh ]; then
export WORKON_HOME=$HOME/.virtualenvs
source /usr/local/python/bin/virtualenvwrapper.sh
fi
Install python3.3 on CentOS Introduction of Virtualenvwrapper
Recommended Posts