jamescasbon / PyVCF

A Variant Call Format reader for Python.
http://pyvcf.readthedocs.org/en/latest/index.html
Other
404 stars 200 forks source link

Cannot import PyVCF in Python 3.5 after successful installation by pip #316

Open nkuyfq opened 5 years ago

nkuyfq commented 5 years ago

I used pip (pip 19.1.1 from /usr/local/lib/python3.5/dist-packages/pip (python 3.5)) to install PyVCF in Ubuntu 16.04 and it succeeded. However, when I imported this module in Python 3.5, it failed. Why? I checked the system path like /usr/local/lib/python3.5/dist-packages, and I could see two directories: PyVCF-0.6.8.dist-info and vcf. Similarly, I installed scipy by using pip, and I was able to import this module in Python 3.5

I have pasted the message from the terminal here:

nkuyfq@nkuyfq-VirtualBox:/opt$ sudo pip install PyVCF WARNING: The directory '/home/nkuyfq/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag. WARNING: The directory '/home/nkuyfq/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag. Collecting PyVCF Requirement already satisfied: setuptools in /usr/lib/python3/dist-packages (from PyVCF) (20.7.0) Installing collected packages: PyVCF Successfully installed PyVCF-0.6.8

nkuyfq@nkuyfq-VirtualBox:/opt$ python Python 3.5.2 (default, Nov 12 2018, 13:43:14) [GCC 5.4.0 20160609] on linux Type "help", "copyright", "credits" or "license" for more information.

import PyVCF Traceback (most recent call last): File "", line 1, in ImportError: No module named 'PyVCF'

hezscha commented 4 years ago

It worked for me on python 3.7. Try: import vcf And see if these examples work: https://pyvcf.readthedocs.io/en/latest/INTRO.html