AndersenLab / VCF-kit

VCF-kit: Assorted utilities for the variant call format
http://www.andersenlab.org
MIT License
122 stars 25 forks source link

vk error on RHEL7 #16

Closed beechwood13 closed 5 years ago

beechwood13 commented 6 years ago

Hi, Installation VCF-kit using pip went smoothly and it looked that I had all dependencies installed. However, if I start any of the vk commands, I get the following error:

File "/usr/bin/vk", line 7, in from vcfkit.vk import main File "/usr/lib/python3.4/site-packages/vcfkit/vk.py", line 24, in from utils import lev, message ImportError: cannot import name 'lev'

utils==0.9.0 is installed

Thanks for your help in advance !

arupgsh commented 6 years ago

Facing the same issue in RHEL 7.

jambler24 commented 6 years ago

Same issue here

jrtejero commented 6 years ago

Same issue. Any news?

danielecook commented 6 years ago

Currently, vcf-kit only works with Python 2.7

mayasheth commented 6 years ago

How do you change what version of python you're running vcf-kit through?

danielecook commented 6 years ago

@mayasheth Check out pyenv and pyenv-virtualenv. You can use them to set up python on a per-directory basis.

alanorth commented 5 years ago

I just ran into this issue on CentOS 7 as well. I tried with the system's Python 2.7.5, Python 3.4.9, and a custom Python 2.7.13 virtual environment.

In both Python 2 environments vk fails with:

$ vk
Traceback (most recent call last):
  File "/tmp/vcfkit/bin/vk", line 6, in <module>
    from vcfkit.vk import main
  File "/tmp/vcfkit/lib/python2.7/site-packages/vcfkit/vk.py", line 27, in <module>
    from utils.vcf import *
  File "/tmp/vcfkit/lib/python2.7/site-packages/vcfkit/utils/vcf.py", line 10, in <module>
    np.set_printoptions(threshold=np.nan)
  File "/tmp/vcfkit/lib/python2.7/site-packages/numpy/core/arrayprint.py", line 246, in set_printoptions
    floatmode, legacy)
  File "/tmp/vcfkit/lib/python2.7/site-packages/numpy/core/arrayprint.py", line 93, in _make_options_dict
    raise ValueError("threshold must be numeric and non-NAN, try "
ValueError: threshold must be numeric and non-NAN, try sys.maxsize for untruncated representation

On Python 3.4 it fails with:

$ vk
Traceback (most recent call last):
  File "/tmp/vcfkit-python3/bin/vk", line 11, in <module>
    load_entry_point('VCF-kit==0.1.6', 'console_scripts', 'vk')()
  File "/tmp/vcfkit-python3/lib64/python3.4/site-packages/pkg_resources/__init__.py", line 487, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/tmp/vcfkit-python3/lib64/python3.4/site-packages/pkg_resources/__init__.py", line 2728, in load_entry_point
    return ep.load()
  File "/tmp/vcfkit-python3/lib64/python3.4/site-packages/pkg_resources/__init__.py", line 2346, in load
    return self.resolve()
  File "/tmp/vcfkit-python3/lib64/python3.4/site-packages/pkg_resources/__init__.py", line 2352, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/tmp/vcfkit-python3/lib64/python3.4/site-packages/vcfkit/vk.py", line 24, in <module>
    from utils import lev, message
ImportError: No module named 'utils'

What is the correct Python to run VCF-Kit with? Can you please add some notice to the README.md to guide us? Thanks!

chromatimera commented 5 years ago

I'm in the exact same situation as @alanorth. Any suggestions how to get it running?

danielecook commented 5 years ago

@alanorth @chromatimera It isn't compatible with Python3 currently.

I'm think there must be some sort of incompatibility with an update to numpy. I'm a bit stretched on time right now, but I would like to find a solution in the near future.

A quick workaround would be to use conda or docker.

Please see: https://bioconda.github.io/recipes/vcfkit/README.html

Which also lists an available docker container:

docker pull quay.io/repository/biocontainers/vcfkit
chromatimera commented 5 years ago

Hi @danielecook ! I was using VCF-kit over the last few days and after a conda update it is now giving an error as below:

Traceback (most recent call last): File "/home/ofelia/anaconda2/bin/vk", line 7, in <module> from vcfkit.vk import main File "/home/ofelia/anaconda2/lib/python2.7/site-packages/vcfkit/vk.py", line 27, in <module> from utils.vcf import * File "/home/ofelia/anaconda2/lib/python2.7/site-packages/vcfkit/utils/vcf.py", line 10, in <module> np.set_printoptions(threshold=np.nan) File "/home/ofelia/anaconda2/lib/python2.7/site-packages/numpy/core/arrayprint.py", line 246, in set_printoptions floatmode, legacy) File "/home/ofelia/anaconda2/lib/python2.7/site-packages/numpy/core/arrayprint.py", line 93, in _make_options_dict raise ValueError("threshold must be numeric and non-NAN, try " ValueError: threshold must be numeric and non-NAN, try sys.maxsize for untruncated representation Same goes for trying to access it with docker: Traceback (most recent call last): File "/home/ofelia/anaconda2/bin/vk", line 7, in <module> from vcfkit.vk import main File "/home/ofelia/anaconda2/lib/python2.7/site-packages/vcfkit/vk.py", line 27, in <module> from utils.vcf import * File "/home/ofelia/anaconda2/lib/python2.7/site-packages/vcfkit/utils/vcf.py", line 10, in <module> np.set_printoptions(threshold=np.nan) File "/home/ofelia/anaconda2/lib/python2.7/site-packages/numpy/core/arrayprint.py", line 246, in set_printoptions floatmode, legacy) File "/home/ofelia/anaconda2/lib/python2.7/site-packages/numpy/core/arrayprint.py", line 93, in _make_options_dict raise ValueError("threshold must be numeric and non-NAN, try " ValueError: threshold must be numeric and non-NAN, try sys.maxsize for untruncated representation Is there any way I can downgrade the numpy package in order to make it work? I would really appreciate some help!

niyomiw commented 4 years ago

If anyone is still trying to make VCF-kit work. It works on python 2.7.10 and gcc/4.7.2