Difference between revisions of "Python2"

From John Freier
Jump to: navigation, search
(Created page with "This is a dumping ground for my python2 memory. == PIP == pip is a dependency manager for python. It stores all dependencies in requirements.txt pip install -r requirement...")
 
(No difference)

Latest revision as of 16:32, 17 December 2020

This is a dumping ground for my python2 memory.

PIP

pip is a dependency manager for python. It stores all dependencies in requirements.txt

 pip install -r requirements.txt

VirtualEnv

This is special environment for pythons so you don't have to worry about mixing up system wide dependencies.

So virtualEnv 1 has python version 2.7.11 and virtualEnv 2 has python version 2.7.12

To install virtualenv.

 pip install virtualenv

to setup an virtual enviroment use the following command.

 virtualenv project1

This will create a sub directory called project1.

Then you can activate the virtualenv by using the following command.

 source ./project1/bin/activate

Once in the virtual environment you can see which python is setup

 which python

or list all dependencies

 pip list

You can leave the virtual environment by using the following command.

 deactivate.