I first needed to clean up my older setup. In the past I used a .pydistutils.cfg file that was in my home directory to tell easy_install to use my custom directories (which were in my PYTHONPATH). I removed this. Then I downloaded the virtualenv tarball from pypi and did the usual python setup.py install dance.
$ cd virtualenv-1.0
$ sudo python setup.py install --prefix=/usr/local
Then I did the following:
$ mkdir -p ~/usr/virtualenv
$ cd ~/usr/virtualenv
$ virtualenv ets_stabe # for ETS-2.7.1
$ ln -s ets_stable/bin/activate .
# edit .bash_profile and add "source ~/usr/virtualenv/activate" (or whatever for your particular shell) to it.
Now, either login afresh or source ~/usr/virtualenv/activate to use the newly created virtual environment.
Now you are all set. I then installed ETSProjectTools and installed ets==2.7.1 and everything else I needed in the stable environment (using either python setup.py [option] or via easy_install). You just need to make sure you use the corresponding virtual environments python and easy_install.
To switch to the truk I created another virtualenv like so:
cd ~/usr/virtualenv
virtualenv ets_trunk
Then I installed the trunk related packages here. To switch between virtual environments I have a small shell script that looks like this:
#!/bin/sh
# switch_ets.sh
cd ~/usr/virtualenv
rm activate
ln -s $1/bin/activate .
So to switch I simply run:
$ switch_ets.sh ets_trunk
and I'm all set to go when I start a new shell.
No comments:
Post a Comment