1. 下载python 2.7编译安装
$wget http://www.python.org/ftp/python/2.7.3/Python-2.7.3.tgz $tar zxvf Python-2.7.3.tgz $cd Python-2.7.3 $./configure $make && make install
2. 然后安装python-setuptools 到pypi网站下载python-setuptools,版本要和yum的时候版本一致,不然运行的时候会出错
$wget http://pypi.python.org/packages/source/s/setuptools/setuptools-0.6c5.tar.gz $tar zxvf setuptools-0.6c5.tar.gz $cd setuptools-0.6c5 $python setup.py install
3. 装完setuptools 就可以安装 virtualenv
easy_install virtualenv
4. 建环境,
mkdir mypyenv virtualenv mypyenv cd mypyenv source bin/activate python -V # 退出环境 deactivate
时间: 2024-10-26 19:46:49