Skip to content

Setting up virtualenv, pip, virtualenvwrapper and IPython on Fedora

by on October 2, 2011

Install the necessary packages.

sudo yum -y install python-pip ipython

Use pip to install virtualenvwrapper and virtualenv to our home directory.

echo 'alias pip="pip-python"' >> .bashrc
source .bashrc
pip install --install-option="--prefix=$HOME" virtualenvwrapper

Setup environment for virtualenv.

mkdir ~/virtualenvs
echo 'export WORKON_HOME=$HOME/virtualenvs' >> .bashrc
echo 'source $HOME/bin/virtualenvwrapper.sh' >> .bashrc
source .bashrc
workon

Setup postmkvirtualenv script to install IPython. I adapted the postmkvirtualenv script from here.

echo 'CACHE=$WORKON_HOME/.pip-cache
mkdir -p "$CACHE"
$VIRTUAL_ENV/bin/pip install --download-cache="$CACHE" ipython' >> $WORKON_HOME/postmkvirtualenv

Create test virtualenv.

mkvirtualenv --no-site-packages test-ipython
cdvirtualenv
ipython --c='print("success")'
deactivate
rmvirtualenv test-ipython

Enjoy.

About these ads

From → General, Python

One Comment

Trackbacks & Pingbacks

  1. Install virtualenv on Fedora 16 | Q&A System

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

Follow

Get every new post delivered to your Inbox.