Linux under compile and install Python 3.4updated on 2014-09-24 02:01:05 ueaner
System environment:
- CentOS 6.5 X86_64/fedora x86_64
Install related Packages
# yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gcc make
Download Python 3.4 Source Package
# wget http://mirrors.sohu.com/python/3.4.1/Python-3.4.1.tar.xz
Installing Python 3.4
# xz -d Python-3.4.1.tar.xz# tar xf Python-3.4.1.tar -C /usr/local/src/# cd /usr/local/src/Python-3.4.1/# ./configure --prefix=/usr/local/python34# make -j8 && make install
From the beginning of Python 3.4, the Pip and Easy_install (Setuptools Package command) package Management command, which you can see in the /usr/local/python34/bin/
directory, looks at the installed expansion pack:
# /usr/local/python34/bin/pip3 listpip (1.5.6)setuptools (2.1)
Adding python3.4 related commands to environment variables
Add python3.4 to environment variable, edit ~/.bash_profile
, will:
PATH=$PATH:$HOME/bin改为:PATH=$PATH:$HOME/bin:/usr/local/python34/bin
Make the python3.4 environment variable effective:
# . ~/.bash_profile
View the following version:
# python3 --versionPython 3.4.1
Complete!
Linux under compile and install Python 3.4