We've moved!
This site is now read-only. You can find our new documentation site and support forum for posting questions here.
Be sure to read our welcome blog!

(howto) Install Python libraries (=packages)

Geraldine_VdAuweraGeraldine_VdAuwera Cambridge, MAMember, Administrator, Broadie admin
edited May 2014 in Oncotator documentation

PyPI and pip

Most external Python libraries can be installed using package managers. There are several options; we like to use pip, which conveniently retrieves libraries by name from the Python Package Index (PyPI) using a simple command, e.g.

$ pip install virtualenv

The main caveat to watch out for when you depend on pip is that some libraries have dependencies that are not Python-based and can't be installed with pip. For example, if you try to install the scipy library but you don't have the FORTRAN and BLAS packages installed, pip will fail with a fairly obscure compilation-related error. In that case, you have to find out where to get those packages and install them before you can attempt to install the library you were originally trying to get. For this (as for many other things in scientific computing) Google and Stackoverflow are your friends.

Manual installation

When your favorite package manager has failed you (for example if the library you want is not in PyPI) it's time to resort to installing things manually. Most civilized Python packages come with a setup script that can be invoked very easily by running:

$ python setup.py install

from within the directory where the script lives. This will copy the necessary files in your Python environment and make the library available to Python.

Some packages are a little more complicated and require you to first do a compilation step before you install. Always read the README and/or INSTALL documents that come with the downloaded package, which will provide you with detailed instructions that are specific to that package.

Getting help

If you experience issues installing Python libraries, please don't ask us how to do it -- that is beyond the scope of support that we are able to provide at this time. Instead, have a look at the beginner's guide to Python on their documentation website. If that doesn't help, remember that Google and Stackoverflow are your friends.

Post edited by Geraldine_VdAuwera on
Sign In or Register to comment.