Dealing with virtualenv in python3

Víctor Pérez Berruezo
Tiendeo Tech
Published in
1 min readNov 19, 2018

Sometimes when programming in python we have version incompatibilities between projects.
In order to avoid that, we can build different environments depending on which versions of the libraries work on each project (or even have different python versions: one in python3.6 and another in python2.7).

MAC

  • Install python [download]
  • Install pip usingpip3 install virtualenv or downloading it [here]
  • Go to the path where your environment will be placed: cd enviroment/path/route
  • Usepython3 -m virtualenv EnvName to create the environment named EnvName inside enviroment/path/route
  • Activate the environment source EnvName/bin/activate

WINDOWS

  • Install python [download]
  • Install pip usingpip3 install virtualenv or downloading it [here]
  • Go to the path where your environment will be placed: cd enviroment/path/route
  • Use virtualenv EnvName to create the environment named EnvName inside enviroment/path/route . (Use virtualenv --python=C:\absolute\path\of\the\python.exe EnvName to select a specific python version)
  • Activate the enviroment source EnvName/Scripts/activate

You can then use pip install -r requierements.txt to install a requirements file.

--

--

Víctor Pérez Berruezo
Tiendeo Tech

Easy | Enjoy finding solutions · Tecnopolítica · Dades Obertes · Python