manually installing pysam error: “ImportError: No module named version”

时光总嘲笑我的痴心妄想 提交于 2019-12-25 08:48:31

问题


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

回答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.



来源:https://stackoverflow.com/questions/46447724/manually-installing-pysam-error-importerror-no-module-named-version

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!