Home > Uncategorized > Quick Primer: python virtual environments

Quick Primer: python virtual environments

Install virtual environment:

easy_install virtualenv virtualenvwrapper

Create a virtual environment:

virtualenv /root/testvirtualenv

Active your virtual environment:

source /root/testvirtualenv/bin/active

Install yolk to manage the packages and python-ldap for fun within your virtualenv

easy_install yolk
easy_install python-ldap

List the packages installed

yolk -l

Leave the virtual environment

deactivate

then

yolk-l

you will see that it is not found.

if, outside of your virtualenv, you:

easy_install yolk

then run

yolk -l

you will see python-ldap in a non-active state!

Here is a great write up on virtual environments. (yes, this dude uses the word “primer”too).

Advertisements
  1. No comments yet.
  1. November 4, 2011 at 9:25 pm

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: