nspies / svviz2

for visual evaluation of read support for structural variation
50 stars 13 forks source link

Installation issue #60

Closed ObliviousMonkey closed 3 years ago

ObliviousMonkey commented 5 years ago

I'm having trouble installing svviz2 on an Ubuntu 19.04 VM. I've created a "mantaEnv" virtual environment using virtualenv, used the recommended pip command to install, tested it with svviz2 --help and that's where things go wrong. Force reinstalling genomeview doesn't change the error which keeps coming back. What am I doing wrong ?

EDIT: I've installed Cython in the virtualenv as per this thread, then force reinstalled both genomeview and svviz2, but the same error keeps popping up when doing svviz2 --help. I'm listing pip list output for reference after the chunk below.

(mantaEnv) discodingo@dVM:~$ pip install -U git+git://github.com/nspies/svviz2.git

Collecting git+git://github.com/nspies/svviz2.git
  Cloning git://github.com/nspies/svviz2.git to /tmp/pip-req-build-hadhongy
  Running command git clone -q git://github.com/nspies/svviz2.git /tmp/pip-req-build-hadhongy
Requirement already satisfied, skipping upgrade: pysam>=0.10 in ./mantaEnv/lib/python3.7/site-packages (from svviz2==2.0a3) (0.15.3)
Requirement already satisfied, skipping upgrade: numpy>=1.11.1 in ./mantaEnv/lib/python3.7/site-packages (from svviz2==2.0a3) (1.17.1)
Requirement already satisfied, skipping upgrade: pyfaidx in ./mantaEnv/lib/python3.7/site-packages (from svviz2==2.0a3) (0.5.5.2)
Requirement already satisfied, skipping upgrade: tqdm in ./mantaEnv/lib/python3.7/site-packages (from svviz2==2.0a3) (4.35.0)
Requirement already satisfied, skipping upgrade: pandas in ./mantaEnv/lib/python3.7/site-packages (from svviz2==2.0a3) (0.25.1)
Requirement already satisfied, skipping upgrade: seqlib>=0.0.6 in ./mantaEnv/lib/python3.7/site-packages (from svviz2==2.0a3) (0.0.6)
Requirement already satisfied, skipping upgrade: genomeview in ./mantaEnv/lib/python3.7/site-packages (from svviz2==2.0a3) (1.0.1)
Requirement already satisfied, skipping upgrade: setuptools>=0.7 in ./mantaEnv/lib/python3.7/site-packages (from pyfaidx->svviz2==2.0a3) (41.2.0)
Requirement already satisfied, skipping upgrade: six in ./mantaEnv/lib/python3.7/site-packages (from pyfaidx->svviz2==2.0a3) (1.12.0)
Requirement already satisfied, skipping upgrade: python-dateutil>=2.6.1 in ./mantaEnv/lib/python3.7/site-packages (from pandas->svviz2==2.0a3) (2.8.0)
Requirement already satisfied, skipping upgrade: pytz>=2017.2 in ./mantaEnv/lib/python3.7/site-packages (from pandas->svviz2==2.0a3) (2019.2)
Requirement already satisfied, skipping upgrade: pybind11>=1.7 in ./mantaEnv/lib/python3.7/site-packages (from seqlib>=0.0.6->svviz2==2.0a3) (2.3.0)
Building wheels for collected packages: svviz2
  Building wheel for svviz2 (setup.py) ... done
  Created wheel for svviz2: filename=svviz2-2.0a3-cp37-cp37m-linux_x86_64.whl size=202123 sha256=ae52f1c301372450318126eda61acc099244be7defc23d1ff5b5596db917d011
  Stored in directory: /tmp/pip-ephem-wheel-cache-4u95mbt8/wheels/f1/04/34/efbc0aafd8423c3c574c4f15164ac914dc3d8027a8153fceec
Successfully built svviz2
Installing collected packages: svviz2
Successfully installed svviz2-2.0a3

(mantaEnv) discodingo@dVM:~$ svviz2 --help

ssw library not found
ERROR:root:Unable to load cythonized quickconsensus module; this is likely because pysam has been updated since genomeview was originally install. To fix this, force reinstall genomeview: 
  pip install --upgrade --force-reinstall genomeview
Traceback (most recent call last):
  File "/home/discodingo/mantaEnv/bin/svviz2", line 6, in <module>
    from svviz2.app.main import main
  File "/home/discodingo/mantaEnv/lib/python3.7/site-packages/svviz2/app/main.py", line 7, in <module>
    from svviz2.visualize import visualize
  File "/home/discodingo/mantaEnv/lib/python3.7/site-packages/svviz2/visualize/visualize.py", line 8, in <module>
    from genomeview import Document, ViewRow, GenomeView
  File "/home/discodingo/mantaEnv/lib/python3.7/site-packages/genomeview/__init__.py", line 24, in <module>
    from genomeview.bamtrack import *
  File "/home/discodingo/mantaEnv/lib/python3.7/site-packages/genomeview/bamtrack.py", line 6, in <module>
    from genomeview import MismatchCounts
ImportError: cannot import name 'MismatchCounts' from 'genomeview' (/home/discodingo/mantaEnv/lib/python3.7/site-packages/genomeview/__init__.py)

(mantaEnv) discodingo@dVM:~$ pip install --upgrade --force-reinstall genomeview

Collecting genomeview
Collecting numpy (from genomeview)
  Using cached https://files.pythonhosted.org/packages/25/eb/4ecf6b13897391cb07a4231e9d9c671b55dfbbf6f4a514a1a0c594f2d8d9/numpy-1.17.1-cp37-cp37m-manylinux1_x86_64.whl
Collecting pysam (from genomeview)
Installing collected packages: numpy, pysam, genomeview
  Found existing installation: numpy 1.17.1
    Uninstalling numpy-1.17.1:
      Successfully uninstalled numpy-1.17.1
  Found existing installation: pysam 0.15.3
    Uninstalling pysam-0.15.3:
      Successfully uninstalled pysam-0.15.3
  Found existing installation: genomeview 1.0.1
    Uninstalling genomeview-1.0.1:
      Successfully uninstalled genomeview-1.0.1
Successfully installed genomeview-1.0.1 numpy-1.17.1 pysam-0.15.3

(mantaEnv) discodingo@dVM:~$ svviz2 --help

ssw library not found
ERROR:root:Unable to load cythonized quickconsensus module; this is likely because pysam has been updated since genomeview was originally install. To fix this, force reinstall genomeview: 
  pip install --upgrade --force-reinstall genomeview
Traceback (most recent call last):
  File "/home/discodingo/mantaEnv/bin/svviz2", line 6, in <module>
    from svviz2.app.main import main
  File "/home/discodingo/mantaEnv/lib/python3.7/site-packages/svviz2/app/main.py", line 7, in <module>
    from svviz2.visualize import visualize
  File "/home/discodingo/mantaEnv/lib/python3.7/site-packages/svviz2/visualize/visualize.py", line 8, in <module>
    from genomeview import Document, ViewRow, GenomeView
  File "/home/discodingo/mantaEnv/lib/python3.7/site-packages/genomeview/__init__.py", line 24, in <module>
    from genomeview.bamtrack import *
  File "/home/discodingo/mantaEnv/lib/python3.7/site-packages/genomeview/bamtrack.py", line 6, in <module>
    from genomeview import MismatchCounts
ImportError: cannot import name 'MismatchCounts' from 'genomeview' (/home/discodingo/mantaEnv/lib/python3.7/site-packages/genomeview/__init__.py)
(mantaEnv) discodingo@vm:~$ pip list

Package            Version
------------------ -------
atomicwrites       1.3.0  
attrs              19.1.0 
cffi               1.12.3 
Cython             0.29.13
genomeview         1.0.1  
genosv             0.3.0  
importlib-metadata 0.20   
Jinja2             2.10.1 
MarkupSafe         1.1.1  
more-itertools     7.2.0  
numpy              1.17.1 
packaging          19.1   
pandas             0.25.1 
pip                19.2.3 
pluggy             0.12.0 
py                 1.8.0  
pybind11           2.3.0  
pycparser          2.19   
pyfaidx            0.5.5.2
pyparsing          2.4.2  
pysam              0.15.3 
pytest             5.1.2  
python-dateutil    2.8.0  
pytz               2019.2 
rpy2               3.1.0  
seqlib             0.0.6  
setuptools         41.2.0 
simplegeneric      0.8.1  
six                1.12.0 
svviz2             2.0a3  
tqdm               4.35.0 
tzlocal            2.0.0  
wcwidth            0.1.7  
wheel              0.33.6 
zipp               0.6.0
cenders commented 5 years ago

@ObliviousMonkey I was experiencing the same issue on RHEL 6/7.

In my case the underlying issue was genomeview having issues cythonizing files, which resulted in a segfault. I got around that by downloading the genomeview source and manually installing it into the environment.

virtualenv svviz2-2.0a
source svviz2-2.0a
mkdir svviz2-2.0a/src
cd svviz2-2.0a/src
wget https://github.com/nspies/genomeview/archive/v1.0.1.tar.gz
tar -zxf v1.0.1.tar.gz
cd genomeview-1.0.1
python setup.py install

I didn't get any errors at this point in my miniconda3 environment but I did get this error inside a virtualenv:

cythoning genomeview/_quickconsensus.pyx to genomeview/_quickconsensus.c
Segmentation fault (core dumped)

After running python setup.py install again it seems to install just fine.

python setup.py install
pip install -U git+git://github.com/nspies/svviz2.git
svviz2

It seems that cythonizing that file only fails the first time around and not the second. I think the build gets cleaned up by pip after it fails, but not with the setuptools installation method. Maybe there are dependencies that are not found the first time around?

ObliviousMonkey commented 5 years ago

@cenders This approach did not initially work for me in virtualenv.

I then made a miniconda3 env, where the same approach did not work either. However force reinstalling genomeview through pip finally solved it for me, I don't know why:

pip install -U --force-reinstall git+https://github.com/nspies/genomeview.git

Thank you!!