hall-lab / svtyper

Bayesian genotyper for structural variants
MIT License
125 stars 55 forks source link

Error during setup #119

Closed rsolano1-uw closed 3 years ago

rsolano1-uw commented 3 years ago

Hello,

I am trying to build svtyper inside of a python 3.7.7 environment and I am running into difficulty. When I attempt to build the software with python3 setup.py, I receive the following errors:

byte-compiling build/bdist.linux-x86_64/egg/svtyper/classic.py to classic.cpython-37.pyc
  File "build/bdist.linux-x86_64/egg/svtyper/classic.py", line 416
    print '--------------------------'
                                     ^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print('--------------------------')?

byte-compiling build/bdist.linux-x86_64/egg/svtyper/parsers.py to parsers.cpython-37.pyc
  File "build/bdist.linux-x86_64/egg/svtyper/parsers.py", line 483
    except KeyError, e:
                   ^
SyntaxError: invalid syntax

byte-compiling build/bdist.linux-x86_64/egg/svtyper/singlesample.py to singlesample.cpython-37.pyc
  File "build/bdist.linux-x86_64/egg/svtyper/singlesample.py", line 420
    best, second_best = sorted([ (i, e) for i, e in enumerate(gt_lplist) ], key=lambda(x): x[1], reverse=True)[0:2]
                                                                                      ^
SyntaxError: invalid syntax

The compilation eventually finishes, and when I attempt to launch the svtyper software to see if it is working, I again see the same print error:

$ bin/svtyper
Traceback (most recent call last):
  File "bin/svtyper", line 11, in <module>
    load_entry_point('svtyper==0.7.1', 'console_scripts', 'svtyper')()
  File "/net/gs/vol3/software/modules-sw/python/3.7.7/Linux/CentOS7/x86_64/lib/python3.7/site-packages/pkg_resources/__init__.py", line 489, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/net/gs/vol3/software/modules-sw/python/3.7.7/Linux/CentOS7/x86_64/lib/python3.7/site-packages/pkg_resources/__init__.py", line 2852, in load_entry_point
    return ep.load()
  File "/net/gs/vol3/software/modules-sw/python/3.7.7/Linux/CentOS7/x86_64/lib/python3.7/site-packages/pkg_resources/__init__.py", line 2443, in load
    return self.resolve()
  File "/net/gs/vol3/software/modules-sw/python/3.7.7/Linux/CentOS7/x86_64/lib/python3.7/site-packages/pkg_resources/__init__.py", line 2449, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 963, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 906, in _find_spec
  File "<frozen importlib._bootstrap_external>", line 1280, in find_spec
  File "<frozen importlib._bootstrap_external>", line 1254, in _get_spec
  File "<frozen importlib._bootstrap_external>", line 1235, in _legacy_get_spec
  File "<frozen importlib._bootstrap>", line 441, in spec_from_loader
  File "<frozen importlib._bootstrap_external>", line 594, in spec_from_file_location
  File "/net/gs/vol3/software/modules-sw-python/3.7.7/svtyper/09152020/Linux/CentOS7/x86_64/lib/python3.7/site-packages/svtyper-0.7.1-py3.7.egg/svtyper/classic.py", line 416
    print '--------------------------'
                                     ^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print('--------------------------')?

This is with Python 3.7.7 on CentOS 7.

rsolano1-uw commented 3 years ago

I figured out the problem. svtyper needs Python 2.7.X to build, but provides dependencies that, by default, want python 3.X to build. To work around this I had to manually build Python 2.7.X versions of the following: numpy scipy pysam toolz

And then load them into my environment and re-run the svtyper setup, which then completed and I was able to run svtyper --help successfully.

yqlan commented 3 months ago

I figured out the problem. svtyper needs Python 2.7.X to build, but provides dependencies that, by default, want python 3.X to build. To work around this I had to manually build Python 2.7.X versions of the following: numpy scipy pysam toolz

And then load them into my environment and re-run the svtyper setup, which then completed and I was able to run svtyper --help successfully.

Hi @rsolano1-uw , would you please elaborate how you did that?

thanks