install a library for python

i'm trying to install a library for python of gene ontology programming [GOGrapher]. In the page they told me this:

$ `svn co https://projects.dbbe.musc.edu/public/GOGrapher/trunk GOGrapher`
$ cd GOGrapher
$ su -
# python setup.py install

I do everything, but in the last step a get an error

error: /usr/local/lib/python2.7/dist-packages/GOGrapher-0.0.egg-info: Permission denied

What is wrong? I'm new on this, but I do what I can.

Upvotes: 3

Views: 543

Answers (2)

gpoo
gpoo

Reputation: 8638

It is not a good idea to install things as superuser in the filesystem. In Python you can always install libraries locally.

Assuming you are already in GOGrapher directory:

$ python setup.py install --home

should install the library in your home directory. Later, you have to add the library PATH to the PYTHONPATH environment variable, so Python will know where to search for it.

$ export PYTHONPATH=$HOME/lib/python

The directory might be slightly different (lib/python2.7 or even lib/python2.7/site-packages), you can check it, tough.

To make it permanent, you should add it in your .profile, .bashrc, or whatever is the shell you are using.

Upvotes: 0

David Robinson
David Robinson

Reputation: 78630

Try

sudo python setup.py install

instead. (Works for me on Mac OS 10.7.3, while the suggested su - solution doesn't).

Upvotes: 1

Related Questions