Using easy_install Without Root / Administrator Permissions
Back to Installation using Prepacked Modules.
easy_install is a package manager of Python which allows to easy_install/distribute packages from the Python Package Index (PyPI). As easy_install often lives in the root directories users can not install packages. In the following it is described how to setup easy_install/distribute such that normal users are able to install packages.
1.) Setting up a User Python Environment
Download virtualenv.py and install it with the distribute option.
python virtualenv.py --distribute --unzip-setuptools $HOME/local
(Change $HOME/local to the directory where you want to setup your local Python (the directory must exist), in windows use backslashes instead of slashes). That is python is installed to $HOME/local/bin, the installed packages will reside in $HOME/local/lib/python2.x/site-packages.
2.) Setting the environment variables to your local Python
Step 1, installed a virtual Python environment to $HOME/local ( Read more ...). This step sets the environment/system variables like PATH such that it points to your $HOME/local Python installation.
2.1) On Linux / Unix / Mac
If you are using the bash type the following (or add it to your .bashrc):
source $HOME/local/bin/activate
which effectively sets the PATH to your local Python installation before the system PATH. C-SHELL users have to do this by hand.
2.2) On Windows
Similar to 2.1, run
\path\to\env\bin\activate.bat
3.) Usage
For example, IPython could be copied and modified to your '$HOME/local/bin' directory or even more easy, install it again. Therefore from the (windows/linux) command line, run:
easy_install ipython
Attachments
-
virtualenv.py
(73.8 KB) -
added by beyreuth 16 months ago.
Updating virtualenv.py to newer version ( http://bitbucket.org/ianb/virtualenv/raw/tip/virtualenv.py)
