> CentOS > CentOS教程 >

CentOS6.5安装python3.4.3

1、安装依赖包

yum install  gcc gcc-c++ openssl-devel zlib zlib-devel

 

2、下载,并编译安装

# cd /usr/src
# wget https://www.python.org/ftp/python/3.4.3/Python-3.4.3.tgz
# tar xzf Python-3.4.3.tgz
#cd Python-3.4.3
# ./configure
# make altinstall

 

3、安装ez_setup和pip

#cd ..

#wget https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py

#/usr/local/bin/python3.4 ez_setup.py

#/usr/local/bin/easy_install-3.4 pip

#/usr/local/bin/pip3.4 install virtualenv

 

4、启用virtualenv

#cd

#/usr/local/bin/virtualenv-3.4 env1

#cd env1

#bin/activate

(env1)locahost~#python -V

(责任编辑:IT)