Setup python virtual environment

不二黑貓發表於2015-07-10
1. install pip

2. install virtualenvwrapper
      pip install virtualenvwrapper

3. setup env
      if [ -f /usr/local/bin/virtualenvwrapper.sh ];  then
            export WORKON_HOME=$HOME/.virtualenvs
            source /usr/local/bin/virtualenvwrapper.sh
      fi

4. reread .bash_profile
      source $HOME/.bash_profile

5. create a special python version
      mkvirtualenv --python=/usr/bin/python2.7 pangu

6. enter 'pangu' virtual environment
      workon pangu


7. exit 'pangu' virtual environment
      deactivate

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/30083145/viewspace-1729267/,如需轉載,請註明出處,否則將追究法律責任。

相關文章