在CentOS 6.5下的virtualenvwrapper的使用
2014-09-16 16:43
211 查看
1,先yum intall virtualenv
2,然后pip install virtualenvwrapper
安装完需要配置:
下面代码添加到后面
Shell Startup File
Add three lines to your shell startup file (.bashrc, .profile, etc.) to set the location where the virtual environments should live, the location of your development project directories, and the location of the script installed with this package:
After editing it, reload the startup file (e.g., run source ~/.bashrc).
执行:
这里我没理解,我直接在shell里运行这三个命令也是可以的
-------------------------------------------------------------------------------------------------------------------------安装和配置完了
下面是使用:
mkvirtualenv demo1
workon 切换到环境
deactivate 注销当前环境
lsvirtualenv 列出所有环境
rmvirtualenv 删除环境
cpvirtualenv 复制环境
cdsitepackages cd到当前环境的site-packages目录
lssitepackages 列出当前环境中site-packages内容
setvirtualenvproject 绑定现存的项目和环境
wipeenv 清除环境内所有第三方包
2,然后pip install virtualenvwrapper
安装完需要配置:
vim ~/.bash_profile
下面代码添加到后面
Shell Startup File
Add three lines to your shell startup file (.bashrc, .profile, etc.) to set the location where the virtual environments should live, the location of your development project directories, and the location of the script installed with this package:
#virtualenvwrapper export WORKON_HOME=$HOME/virtualenvs # 虚拟环境存放位置自己指定 source /usr/bin/virtualenvwrapper.sh # 指定virtualenvwrapper的执行文件路径 export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python # 系统python2.7执行文件位置,根据自己环境而定 export VIRTUALENVWRAPPER_VIRTUALENV_ARGS='--no-site-packages' # 启动时候指定参数,就是我们用的独立于系统的安装包 export PIP_VIRTUALENV_BASE=$WORKON_HOME # 告知pip virtualenv的位置 export PIP_RESPECT_VIRTUALENV=true # 执行pip的时候让系统自动开启虚拟环境
After editing it, reload the startup file (e.g., run source ~/.bashrc).
执行:
source ~/.bash_profile
这里我没理解,我直接在shell里运行这三个命令也是可以的
-------------------------------------------------------------------------------------------------------------------------安装和配置完了
下面是使用:
mkvirtualenv demo1
workon 切换到环境
deactivate 注销当前环境
lsvirtualenv 列出所有环境
rmvirtualenv 删除环境
cpvirtualenv 复制环境
cdsitepackages cd到当前环境的site-packages目录
lssitepackages 列出当前环境中site-packages内容
setvirtualenvproject 绑定现存的项目和环境
wipeenv 清除环境内所有第三方包
相关文章推荐
- CentOS 6.5下Python3.5以及virtualenv、virtualenvwrapper的安装配置
- 使用 virtualenvwrapper 隔离 python 项目的库依赖
- virtualenvwrapper安装使用
- python_virtualenvwrapper安装与使用
- [python]如何使用virtualenvwrapper切换不同版本的python?
- python------virtualenv&virtualenvwrapper的使用
- Virtualenvwrapper在不同Python版本间切换使用
- Windows下virtualenv和virtualenvwrapper的使用
- virtualenv、virtualenvwrapper安装使用
- Virtualenv和Virtualenvwrapper的配置使用
- [python]使用virtualenvWrapper
- Virtualenv和Virtualenvwrapper安装和使用(Mac)
- 如何使用virtualenvwrapper切换不同版本的python
- virtualenv & virtualenvwrapper 的安装使用
- 使用virtualenvwrapper隔离python环境
- 使用virtualenv或virtualenvwrapper搭建独立的python开发环境
- 使用虚拟环境virtualenv/Virtualenvwrapper隔离多个python(tensorflow安装为例)
- virtualenv和virtualenvwrapper介绍和使用
- virtualenv,virtualenvwrapper,pyenv 三大虚拟环境使用
- ubuntu 下安装、配置、使用 virtualenvwrapper