0

I am trying to install pysam manually as I am working on a cluster without internet connection and I do not have admin rights (thus doing it through conda is not possible, which I have tried). I have downloaded all the zipped files from the developer's repository (https://github.com/pysam-developers/pysam/archive/master.zip), then I transfer them to my directory in the cluster.

I have tried the manual installation from the unzipped repository by running (as indicated in the instructions https://github.com/pysam-developers/pysam/blob/master/INSTALL):

python path/to/pysam-master/setup.py build

But I get the following error:

# pysam: cython is available - using cythonize if necessary
Traceback (most recent call last):
  File "path/to/pysam-master/setup.py", line 166, in <module>
    import version
ImportError: No module named version

Line 165, 166 and 167 in the setup.py file are:

165. sys.path.insert(0, "pysam")
 166. import version
 167.version = version.__version__

Unfortunatelly, my knowledge has taken me only this far. Is it necessary to modify the setup.py file?

My system specs:

  • Python 2.7.13 :: Anaconda, Inc.
  • CentOS release 6.5
  • Linux 2.6.32-431.20.5.el6.x86_64
Sergio.pv
  • 1,380
  • 4
  • 14
  • 23

1 Answers1

1

version.py is in path/to/pysam-master/pysam. The script uses the os-module to add the pysam directory to the working directory of the environment before importing:

sys.path.insert(0, "pysam")

So, this specific problem should be solved by replacing the "pysam" in

sys.path.insert(0, "pysam")

with the full path to the pysam-directory.

Sudix
  • 350
  • 2
  • 15
  • the installation runs until it crashes with: error: command 'x86_64-conda_cos6-linux-gnu-gcc' failed with exit status 1 – Sergio.pv Sep 27 '17 at 14:00
  • I will move this to a separated question – Sergio.pv Sep 27 '17 at 14:39
  • Since Sergio hasn't answered yet, and if you haven't found the answer already: Try changing the active directory explicitly in your "setup.py build" call, so you only have to input the command "setup.py build" – Sudix Sep 28 '17 at 05:14
  • this works too and avoids modifying the `setup.py` file – Sergio.pv Sep 28 '17 at 17:32