Virtual environment is essential component of Python world. You can isolate different version of packages into separate environments.

How to set up virtualenv?

Install Python and virtualenv package by pip:

pip install virtualenv

python-insltall-virtualenv

Create directory which will hold the virtual environment (e.g. pyenv34) and initialize it:

virtualenv --system-site-packages pyenv34

python-setup-virtualenv

You can uses system-site-packages option to tell virtualenv to inherit system packages from system installation of Python.

The next step is to activate environment:

.\pyenv34\Scripts\activate.ps1

pyenv-activate

Your command prompt will change and you will see the name of virtual environment in the command line.

Now you can install, uninstall packages by pip and everything will be isolated in the virtual environment directory.

E.g. install ipython

virtual-env-use

It’s time to import antigravity 🙂

pyenv-antigravity

Comments