Advertisement
godlil2e

vmenv

Feb 22nd, 2017
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.28 KB | None | 0 0
  1. #################### virtualenv Installation ######################
  2.  
  3. $ sudo apt-get install python-setuptools python-dev build-essential
  4. $ easy_install pip
  5. $ sudo pip install virtualenv virtualenvwrapper
  6.  
  7. # Python3 (important)
  8. $ sudo apt-get install python3-pip
  9.  
  10. # Add following lines to .bashrc
  11. export WORKON_HOME=$HOME/.virtualenvs
  12. source /usr/local/bin/virtualenvwrapper.sh
  13. export PIP_VIRTUALENV_BASE=$WORKON_HOME
  14.  
  15. ###################################################################
  16.  
  17. ## Instruction ##
  18. # Create virtualenv workspace
  19. $ mkvirtualenv <working_dir>
  20.  
  21.  
  22. # Remove virtualenv workspace
  23. $ rmvirtualenv <virtualenv_name>
  24. # (optional)
  25. $ sudo rm -rf <virtualenv_name_dir>
  26.  
  27.  
  28. # Deactivate current virtualenv
  29. $ deactivate
  30.  
  31. # List or select working virtualenv dir
  32. $ workon
  33. $ workon <virtualenv_name>
  34.  
  35.  
  36. # Install Python module (selected virtualenv)
  37. $ pip install numpy
  38. # OR
  39. $ pip3 install numpy
  40.  
  41.  
  42. # List installed Python modules
  43. $ pip freeze
  44. $ pip3 freeze
  45.  
  46.  
  47.  
  48. ## NOTE ##
  49. # "pip" is a command to donwload and install Python2-3.4 module
  50. # while "pip3" is a command for Python3.5++
  51.  
  52. ## References ##
  53. # https://juacompe.wordpress.com/2013/02/25/how-to-install-virtualenv-and-virtualenvwrappe/
  54. # https://dimamoroz.com/blog/2-python-virtual-environment-ubuntu/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement