Virtualenv python environment manager | extrovert.dev -->

Virtualenv python environment manager

Virtualenv python environment manager
Monday, December 4, 2017



If you are interested in managing the project that would isolate from other python projects then you can use virtualenv. 




With this you can run virtual installations on your developer machine.


To install just pip it:
  
         pip install virtualenv


To create any environment just type this;
   
 virtualenv [environment_name]



To activate any off the environments you have created type;

 source [environment_name]/bin/activate

To deactivate the virtualenv:
   
   $ deactivate

To install virtualenv wrapper:

   $Pip install virtualenvwrapper


Cheatsheet

venv

List or change virutal environments 
venv [environment_name]
To deactivate
venv.exit
Venv.List all of the environments 
venv.ls [-b] [-l] [-h]
-b Brief mode, disables verbose output -l Long mode, verbose output, default -hPrint help
Venv.show
Display single project
venv.show [env]

Create a new environment:
venv.init ENVNAME
venv.init [-a project_path] [-i package] [-r requirements.txt] [virtualenv opts] ENVNAME

Remove an environment 
venv.rm ENVNAME


Switching to other virtual environments.
venv.switch ENVNAME


Adds the specified directories to the Python path 
venv.add dirpath dirpath ..

Change the current working directory
venv.cd

Change the current working directory 
venv.cdsp [subpackage]


Change the current working directory to the directory of the current virtual environmment 
venv.cdenv [subdir]
Display the contents
venv.lssp

Create a new virtualenv and a new project directory 
venv.proj [-f|--force] [-t template] [virtualenv opts] ENVNAMEve

Mix up an existing virtualenv to an existing project 
venv.setproj [virtualenv_path project_path]



2 Responses to Virtualenv python environment manager