- Create and activate a virtualenv:
- Create a virtualenv with system packages
- Create a virtualenv using Python 3 interpreter
- Install a package for the currently activated virtualenv
- Install a package globally
If you need to work with python you'll sooner or later bump into one of these terms so they will be defined here for future reference.
Package installer for Python. Kind of like gem for ruby.
A tool to help you keep multiple versions of python (and separate python packages) for each of your projects. Think of rvm and gemsets for ruby.
Create and activate a virtualenv:
$ virtualenv <your-env-name> $ . <your-env-name>/bin/activate
(to deactivate it, just run
deactivate from anywhere in your system
Create a virtualenv with system packages
To include system packages (i.e. those you have installed with
apt-get or the like) use
$ virtualenv <your-env-name> --system-site-packages
Create a virtualenv using Python 3 interpreter
$ virtualenv -p python3 <your-env-name>
Install a package for the currently activated
(my-env)$ pip install <package-name>
Install a package globally
$ sudo pip install <package-name>