Skip to content Skip to sidebar Skip to footer

Easy_install's --prefix Option Doesn't Change Where It Tries To Install My Package

I want to install Sphinx 1.1.3 for python 2.6. However, I don't have sudo rights. So instead of installing it in the default place, I want to set a different location, using --pref

Solution 1:

You need to specify options before the package, so the command should be:

easy_install --prefix=/homes/ndeklein/python2.6/site-packages/ Sphinx-1.1.3-py2.6.egg 

Solution 2:

This website discusses non-root python installs. It might be useful to you...

http://www.astropython.org/tutorials/user-rootsudo-free-installation-of-python-modules7/

To quote a little bit of it:

A user configuration file, ~/.pydistutils.cfg, will override the internal system path for python package installations, redirecting the built libraries (lib), scripts (bin) and data (share) into user owned and specified directories. You must simply tell the python installer where theses directories are located.

The user file, ~/.pydistutils.cfg, has the following lines, using a pretty obvious syntax:

[install]install_scripts = ~/usr/bin
install_data = ~/usr/share
install_lib = ~/usr/lib/python2.4/site-packages

Of course, whatever directories you specify there should probably exist and you should put them at the front of your PYTHONPATH:

export PYTHONPATH=~/usr/lib/python2.4/site-packages:${PYTHONPATH}

It also looks like more modern python installations (compared to the things in the link) should be able to use the ~/.local directory:

easy_install --prefix=~/.local ...

There is also:

easy_install --user ...

which will install to a user-specific site directory.

Solution 3:

You could try using pip install of easy_install(pip is recommended over easy_install these days)

Then you can just use

pip install --user Sphinx

see http://www.pip-installer.org/en/latest/installing.html on how to install pip if needed

You may also want to pip install virtualenv and work inside virtualenv(where pip will install all packages in a local site packages folder). see http://pypi.python.org/pypi/virtualenv for more info.

Post a Comment for "Easy_install's --prefix Option Doesn't Change Where It Tries To Install My Package"