SmCaterpillar
SmCaterpillar

Reputation: 7020

Pythonpath, ignoring a particular site package and using a local installation/repository

I need a newer version of a particular python package (brian) on our server. Yet, I do not have administrator privileges, so I cannot update the python package installed on the server.

Accordingly, I tried a local installation with pip install --user --ignored-installed brian. That did not work, this simply yields the following console output:

Downloading/unpacking brian
  Running setup.py egg_info for package brian

Cleaning up...

Next, I tried pip install --user --upgrade brian. That does not work either:

...
    shutil.move(old, new)
  File "/usr/lib/python2.7/shutil.py", line 300, in move
    os.unlink(src)
OSError: [Errno 13] Permission denied: '/usr/share/pyshared/brian-1.3.1.egg-info'

Finally, I tried checking out the actual brian repository from github and adding the location to the python path in my bashrc file:

export PYTHONPATH=~/python/pypet:~/python/brian:...:$PYTHONPATH

That does not work either :-/ If I run python (2.7.3) and import brian, it will still use the brian distribution in the global site packages and not the one in the repository.

What can I do about it to make one of these methods work?

Upvotes: 0

Views: 242

Answers (1)

Beka
Beka

Reputation: 745

I'm not sure why the third method doesn't work, but maybe you would like to use virtualenv. It enables setting different packages for each virtual environment, and handles the PYTHONPATH and pip install correctly.

Upvotes: 1

Related Questions