安装python虚拟环境
sudo apt-get install virtualenv
vrtaulenvwrapper 是 virtualenv 的扩展包,用于更方便管理虚拟环境
sudo apt-get install virtualenvwrapper
此时还不能使用 virtualenvwrapper,实际上你需要运行virtualenvwrapper.sh文件才行。
配置步骤如下:
1、查看 virtualenvwrapper 的安装路径
sudo find / -name virtualenvwrapper.sh
2、创建目录用来存放虚拟环境
mkdir ~/.myvirtualenvs
3、在~/.bashrc中添加行
别人写的是 vim .bashrc 进入配置文件,注意/home目录要改成自己的
export WORKON_HOME=/home/yong/.myvirtualenvs
source /usr/share/virtualenvwrapper/virtualenvwrapper.sh
4、运行: source ~/.bashrc
此时 virtualenvwrapper 就可以使用了。




网友评论