Where does easy_install install things?

18.3k Views Asked by At

I want to install sphinx, and the website says to use:

easy_install -U Sphinx

What will happen when I install this command? will I get the source also? Where will it install?

4

There are 4 best solutions below

0
On

On Ubuntu I believe it installs to /usr/local/lib/python2.6/dist-packages/ and I believe it install the egg for it. -U denotes upgrading it if its already installed

0
On

By default, the easy_install install's the packages in the Python's primary site-packages directory. It would usually be /usr/lib/python2.6/site-packages/. However, I have found ubuntu to have it's packages installed in dist-packages directory. There are certain problems with ubuntu packages co-existing with packages installed by a user downloaded setuptools. In those case, you either stick to ubuntu version of your package, if available, or setup all packages from source and probably use custom install location switch for your package installation.

0
On

From the docs:

By default, packages are installed to the running Python installation's site-packages directory, unless you provide the -d or --install-dir option to specify an alternative directory, or specify an alternate location using distutils configuration files.

To get source:

Sometimes a package's source distribution contains additional documentation, examples, configuration files, etc., that are not part of its actual code. If you want to be able to examine these files, you can use the --editable option to EasyInstall, and EasyInstall will look for a source distribution or Subversion URL for the package, then download and extract it or check it out as a subdirectory of the --build-directory you specify.

0
On
/usr/lib/pythonx.y/site-packages

pythonx.y is your version of python. It could be python2.4, python2.7, python3.1, etc.

If you have multiple versions of python on your system, you would easy_install-x.y to install packages for your non-default python. Again x.y is your version of python. You'd use this if you wanted to mess with Python 3, but your system default is 2.7.