I have a problem loading the correct version of a python module. I have no admin rights, so the stuff installed under $PYTHONHOME
and $PYTHONPATH
are read only. Unfortunately the module(s) that reside there are the wrong version. I have the correct version in /some/other/directory
How do I load the correct version instead of the one installed under $PYTHONHOME
? I tried :
import sys
import pkg_resources
sys.path.insert(0, '/some/other/directory/pysam')
pkg_resources.require("pysam=0.9.1.4")
import pysam
version = pkg_resources.get_distribution("pysam").version
print('version= ', version)
I was hoping to get version 0.9.1.4 but I don't. I still get the one installed under $PYTHONPATH
. Prior to running the script I also tried:
export PYTHONPATH=/some/other/directory:$PYTHONPATH
still no cigar. Any ideas?