Changes between Initial Version and Version 1 of VirtualEnv


Ignore:
Timestamp:
Aug 24, 2010, 2:34:51 PM (16 years ago)
Author:
Darren Weber
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • VirtualEnv

    v1 v1  
     1
     2First, get the setuptools package installed.  Note the following has some version specific details that need attention for any current installation.  At the time of writing, this installation used a specific svn-build of Chimera (2010-08-05) and a specific version of setuptools for the version of python that was built for Chimera (python2.7).  It also assumes that Chimera was installed with sudo privileges, but that is not necessary (this should work for a user installation too, without the sudo privileges).
     3
     4{{{
     5$ sudo -i
     6# export CHIMERA=/opt/UCSF/Chimera64-2010-08-05
     7# export PATH=$PATH:$CHIMERA/bin/
     8# export LD_LIBRARY_PATH=$CHIMERA/lib
     9# wget http://pypi.python.org/packages/2.7/s/setuptools/setuptools-0.6c11-py2.7.egg
     10# sh setuptools-0.6c11-py2.7.egg --prefix=$CHIMERA
     11}}}
     12
     13Now use these setuptools to install any python package into the Chimera specific python distribution.  For example, install the virtualenv package, like so:
     14
     15{{{
     16$ sudo -i
     17# export CHIMERA=/opt/UCSF/Chimera64-2010-08-05
     18# export PATH=$PATH:$CHIMERA/bin/
     19# export LD_LIBRARY_PATH=$CHIMERA/lib
     20# $CHIMERA/bin/easy_install-2.7 virtualenv
     21Searching for virtualenv
     22Reading http://pypi.python.org/simple/virtualenv/
     23Reading http://virtualenv.openplans.org
     24Best match: virtualenv 1.4.9
     25Downloading http://pypi.python.org/packages/source/v/virtualenv/virtualenv-1.4.9.tar.gz#md5=c49067cab242b5ff8c7b681a5a99533a
     26Processing virtualenv-1.4.9.tar.gz
     27Running virtualenv-1.4.9/setup.py -q bdist_egg --dist-dir /tmp/easy_install-eNIuwN/virtualenv-1.4.9/egg-dist-tmp-blYuR8
     28warning: no previously-included files matching '*.*' found under directory 'docs/_templates'
     29Adding virtualenv 1.4.9 to easy-install.pth file
     30Installing virtualenv script to /opt/UCSF/Chimera64-2010-08-05/bin
     31
     32Installed /opt/UCSF/Chimera64-2010-08-05/lib/python2.7/site-packages/virtualenv-1.4.9-py2.7.egg
     33Processing dependencies for virtualenv
     34Finished processing dependencies for virtualenv
     35}}}
     36
     37
     38Now that virtualenv is installed in the Chimera python distribution, we can setup any additional custom virtual environments to add python packages into the development environment.  As a regular user, the following will create a Chimera-specific development environment in ~/src/chimera-virtualenv:
     39
     40{{{
     41$ export CHIMERA=/opt/UCSF/Chimera64-2010-08-05
     42$ export PATH=$PATH:$CHIMERA/bin/
     43$ export LD_LIBRARY_PATH=$CHIMERA/lib
     44$ mkdir -p ~/src
     45$ cd ~/src
     46$ $CHIMERA/bin/virtualenv chimera-virtualenv
     47New python executable in chimera-virtualenv/bin/python2.7
     48Also creating executable in chimera-virtualenv/bin/python
     49Installing setuptools.................done.
     50dweber@rbvi-gassho:~/src$ ll chimera-virtualenv/
     51total 20
     52drwxr-xr-x  5 dweber dweber 4096 2010-08-24 14:05 ./
     53drwxr-xr-x 45 dweber dweber 4096 2010-08-24 14:05 ../
     54drwxr-xr-x  2 dweber dweber 4096 2010-08-24 14:05 bin/
     55drwxr-xr-x  2 dweber dweber 4096 2010-08-24 14:05 include/
     56drwxr-xr-x  3 dweber dweber 4096 2010-08-24 14:05 lib/
     57}}}
     58
     59Once this virtual environment is created, it can be activated and deactivated with the following commands (note how the system prompt changes to indicate that we have entered and left the virtual environment).
     60
     61{{{
     62$ source ~/src/chimera-virtualenv/bin/activate
     63(chimera-virtualenv)$ deactivate
     64$
     65}}}