5

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?

api55
  • 11,070
  • 4
  • 41
  • 57
mschmidt
  • 81
  • 1
  • 2
  • 2
    From what I understand this is not the source of your issue, but shouldn't `pysam=0.9.1.4` use double equals, like `pysam==0.9.1.4`? – Majki Jun 09 '17 at 07:04

0 Answers0