Pages

Friday, September 11, 2015

Virtualenv

Arriving at the conclusion that you need virtualenv you quickly enter into how_where_what land.  Your why is because you want multiple versions of python and to pip packages to your hearts content.

This site virtualenv sums it up pretty well but is kind of light on the details.  After reading it you start wandering around for more answers.   Each environment kind of has its own tricks and traps.

I wanted to know how-does-virtualenv-work without reverse-engineering-ian-bicking.  Final answer is: this shell these paths please. 

Before getting into virtualenv you would want to know more about "pip" (package manager).   Pip is one of a set of tools that put the python packages into the python user space.  

So don't forget that the virtualenv command just populates a directory with all the folders and symlinks to the python binaries you want.  

activate and deactivate command exist in reference to the environment that was setup by virtualenv.  They engage and disengage those paths that now exist as directories in your directory.

Install

sudo apt-get install python-dev python-pip python-virtualenv

Setup

Really good rundown on setting up. run-multiple-python-versions-on-your.  Pay attention to the how he manages his environments and the use of ~/.bash_alias

Links



how-does-virtualenv-work

No comments:

Post a Comment