centos6中安装python2.7 与python3.3
2015-12-27 13:24
441 查看
1、配置共享库 /etc/ld.so.conf
include ld.so.conf.d/*.conf
/usr/local/lib
2、下载源码编译
# Python 2.7.6:
wget http://python.org/ftp/python/2.7.6/Python-2.7.6.tar.xz
tar xf Python-2.7.6.tar.xz
cd Python-2.7.6
./configure --prefix=/usr/local --enable-unicode=ucs4 --enable-shared LDFLAGS="-Wl,-rpath /usr/local/lib"
make && make altinstall
# Python 3.3.5:
wget http://python.org/ftp/python/3.3.5/Python-3.3.5.tar.xz
tar xf Python-3.3.5.tar.xz
cd Python-3.3.5
./configure --prefix=/usr/local --enable-shared LDFLAGS="-Wl,-rpath /usr/local/lib"
make && make altinstall
安装好后,查看
include ld.so.conf.d/*.conf
/usr/local/lib
2、下载源码编译
# Python 2.7.6:
wget http://python.org/ftp/python/2.7.6/Python-2.7.6.tar.xz
tar xf Python-2.7.6.tar.xz
cd Python-2.7.6
./configure --prefix=/usr/local --enable-unicode=ucs4 --enable-shared LDFLAGS="-Wl,-rpath /usr/local/lib"
make && make altinstall
# Python 3.3.5:
wget http://python.org/ftp/python/3.3.5/Python-3.3.5.tar.xz
tar xf Python-3.3.5.tar.xz
cd Python-3.3.5
./configure --prefix=/usr/local --enable-shared LDFLAGS="-Wl,-rpath /usr/local/lib"
make && make altinstall
安装好后,查看
/usr/local/bin/python2.7or
/usr/local/bin/python3.3 是否安装成功
3、安装pip
# First get the setup script for Setuptools: wget https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py # Then install it for Python 2.7 and/or Python 3.3: python2.7 ez_setup.py python3.3 ez_setup.py # Now install pip using the newly installed setuptools: easy_install-2.7 pip easy_install-3.3 pip
# With pip installed you can now do things like this: pip2.7 install [packagename] pip2.7 install --upgrade [packagename] pip2.7 uninstall [packagename]
4、配置虚拟环境,创建相应的工程
# Install virtualenv for Python 2.7 and create a sandbox called my27project: pip2.7 install virtualenv virtualenv-2.7 my27project # Use the built-in pyvenv program in Python 3.3 to create a sandbox called my33project: pyvenv-3.3 my33project # Check the system Python interpreter version: python --version # This will show Python 2.6.6
# Activate the my27project sandbox and check the version of the default Python interpreter in it: source my27project/bin/activate python --version # This will show Python 2.7.6 deactivate # Activate the my33project sandbox and check the version of the default Python interpreter in it: source my33project/bin/activate python --version # This will show Python 3.3.5 deactivate
相关文章推荐
- linux中怎样设置DHCP
- Linux经常使用命令(十一) - more
- centos7配置wifi驱动
- linux里查看mysql的一些命令
- VI编辑常用命令
- linux(centos)搭建SVN服务器
- linux中删除文件名称乱码
- linux vi保存退出命令 (如何退出vi)
- [转载]几个有趣的Linux命令
- Linux ->> UBuntu 14.04 LTE下安装Hadoop 1.2.1(伪分布模式)
- windows下模拟linux软件
- CentOS 7部署OpenStack(1)-―准备基础环境
- Linux之htop命令详解
- linux利用mail发送邮件设置
- linux平台下防火墙iptables原理(转)
- linux平台下防火墙iptables原理(转)
- Linux开启ssh服务
- linux常用命令
- Linux命令学习总结:hexdump
- linux 常用命令