标签:user lin activate bin pre local initial py3 创建
安装:
virtualenvwrapper
找到路径:
root@linux:/home/lcg# sudo find / -name virtualenvwrapper.sh /usr/local/bin/virtualenvwrapper.sh
修改.bashrc:
root@linux:/home/lcg# vi ~/.bashrc
最后面加入以下内容后wq保存:
export WORKON_HOME=$HOME/.virtualenvs
source /usr/local/bin/virtualenvwrapper.sh
刷新以下 :
root@linux:~# source ~/.bashrc
然后就可以创建虚拟环境了:
root@linux:~# mkvirtualenv py2scrapy
可以看一下创建结果:
(py2scrapy) root@linux:/# cd ~/.virtualenvs/ (py2scrapy) root@linux:~/.virtualenvs# ls get_env_details postdeactivate postrmvirtualenv premkproject py2scrapy initialize postmkproject preactivate premkvirtualenv postactivate postmkvirtualenv predeactivate prermvirtualenv
创建Python3的虚拟环境:
(py2scrapy) root@linux:~/.virtualenvs# deactivate root@linux:~/.virtualenvs# workon py2scrapy root@linux:~/.virtualenvs# mkvirtualenv --python==/user/bin/python3 py3scrapy
标签:user lin activate bin pre local initial py3 创建
原文地址:http://www.cnblogs.com/lcgsmile/p/7491149.html