virtualenvwrapper安裝和常用指令(mac)


安裝:

1、安裝(要有python環境+pip):
* sudo pip install virtualenvwrapper
2、配置:
執行:vi ~/.bash_profile
在~/.bash_profile中添加:
  export VIRTUALENV_USE_DISTRIBUTE=1        # <-- Always use pip/distribute
  export WORKON_HOME=$HOME/virtualenvs       # <-- Where all virtualenvs will be stored
  source /usr/local/bin/virtualenvwrapper.sh
  export PIP_VIRTUALENV_BASE=$WORKON_HOME
  export PIP_RESPECT_VIRTUALENV=true

3、是~/.bash_profile文件生效
source ~/.bash_profile

常用指令:

1、創建虛擬環境
mkvirtualenv test(續集環境名稱)
2、進入虛擬環境
workon test
3、列出所有虛擬環境
workon
4、離開虛擬環境
deactivate
5、刪除虛擬環境
rmvirtualenc test
6、進入虛擬環境目錄
cd ~/virtualenvs/test

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM