Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pip installation fails on PyVCF #98

Closed
haochenz96 opened this issue Feb 27, 2022 · 9 comments
Closed

Pip installation fails on PyVCF #98

haochenz96 opened this issue Feb 27, 2022 · 9 comments

Comments

@haochenz96
Copy link

haochenz96 commented Feb 27, 2022

Hi,

Thanks for developing this amazing tool!

While I tried to install it with pip today, I got an error saying:

Collecting pyvcf
  Downloading PyVCF-0.6.8.tar.gz (34 kB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [1 lines of output]
      error in PyVCF setup command: use_2to3 is invalid.
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

I believe this is related to PyVCF not compatible with setuptools used in newer Python (mine is Python 3.7.12), as mentioned in this issue: jamescasbon/PyVCF#332

Also, it seems that PyVCF only parses VCF format V4.0 and V4.1, whereas the standard right now is V4.2. The package does not seem to be maintained anymore. So it may be better to switch to a newer VCF parser.

Haochen

@rkimoakbioinformatics
Copy link
Contributor

rkimoakbioinformatics commented Feb 27, 2022

@haochenz96 Thanks for letting us know. It is indeed a known problem. First of all, a workaround is:

>pip install "setuptools<58" --upgrade
>pip uninstall pyvcf
>pip install pyvcf

VCFPy seems to be an alternative. If it proves to be better than PyVCF, it'll be used instead of PyVCF.

@haochenz96
Copy link
Author

Ok. Thanks. I seem to have got around it in another way: I just installed it with

conda install -c bioconda open-cravat

Will try it out and let you know if the PyVCF parser has any issue

@rkimoakbioinformatics
Copy link
Contributor

Ok great. Closing the thread for now.

@BenjaminDEMAILLE
Copy link

Same error

@jasminebro
Copy link
Collaborator

Same error

Hi @BenjaminDEMAILLE . Are you having the same error currently?

@BenjaminDEMAILLE
Copy link

BenjaminDEMAILLE commented Dec 16, 2024 via email

@kmoad
Copy link
Collaborator

kmoad commented Dec 16, 2024

@BenjaminDEMAILLE I'm getting clean installs. Could you please share:

  • What OS you're using
  • How you have python installed (native, anaconda, docker, etc)
  • The output of running pip install open-cravat

@BenjaminDEMAILLE
Copy link

BenjaminDEMAILLE commented Jan 1, 2025

@BenjaminDEMAILLE I'm getting clean installs. Could you please share:

  • What OS you're using
benjamin@MacBook-Pro-de-Benjamin ~ % sw_vers

ProductName:		macOS
ProductVersion:		15.2
BuildVersion:		24C101
  • How you have python installed (native, anaconda, docker, etc)

brew install python3

  • The output of running pip install open-cravat
benjamin@MacBook-Pro-de-Benjamin ~ % pip3 install open-cravat 
Collecting open-cravat
  Downloading open-cravat-2.11.1.tar.gz (3.1 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.1/3.1 MB 12.5 MB/s eta 0:00:00
  Preparing metadata (setup.py) ... done
Requirement already satisfied: pyyaml in /opt/homebrew/lib/python3.10/site-packages (from open-cravat) (6.0)
Requirement already satisfied: requests in /opt/homebrew/lib/python3.10/site-packages (from open-cravat) (2.28.2)
Collecting requests-toolbelt (from open-cravat)
  Downloading requests_toolbelt-1.0.0-py2.py3-none-any.whl.metadata (14 kB)
Collecting pyliftover (from open-cravat)
  Downloading pyliftover-0.4.1-py3-none-any.whl.metadata (3.4 kB)
Collecting websockets (from open-cravat)
  Downloading websockets-14.1-cp310-cp310-macosx_11_0_arm64.whl.metadata (6.7 kB)
Requirement already satisfied: markdown in /opt/homebrew/lib/python3.10/site-packages (from open-cravat) (3.4.1)
Requirement already satisfied: aiohttp<4.0.0 in /opt/homebrew/lib/python3.10/site-packages (from open-cravat) (3.8.3)
Collecting chardet>=3.0.4 (from open-cravat)
  Using cached chardet-5.2.0-py3-none-any.whl.metadata (3.4 kB)
Collecting aiosqlite (from open-cravat)
  Downloading aiosqlite-0.20.0-py3-none-any.whl.metadata (4.3 kB)
Collecting oyaml (from open-cravat)
  Downloading oyaml-1.0-py2.py3-none-any.whl.metadata (1.2 kB)
Collecting intervaltree (from open-cravat)
  Downloading intervaltree-3.1.0.tar.gz (32 kB)
  Preparing metadata (setup.py) ... done
Collecting xlsxwriter (from open-cravat)
  Downloading XlsxWriter-3.2.0-py3-none-any.whl.metadata (2.6 kB)
Requirement already satisfied: openpyxl in /opt/homebrew/lib/python3.10/site-packages (from open-cravat) (3.0.10)
Collecting twobitreader (from open-cravat)
  Downloading twobitreader-3.1.7.tar.gz (9.2 kB)
  Preparing metadata (setup.py) ... done
Requirement already satisfied: nest-asyncio in /opt/homebrew/lib/python3.10/site-packages (from open-cravat) (1.5.6)
Requirement already satisfied: psutil in /opt/homebrew/lib/python3.10/site-packages (from open-cravat) (5.9.4)
Requirement already satisfied: mpmath in /opt/homebrew/lib/python3.10/site-packages (from open-cravat) (1.3.0)
Collecting PyVCF3 (from open-cravat)
  Downloading PyVCF3-1.0.3.tar.gz (977 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 977.6/977.6 kB 42.3 MB/s eta 0:00:00
  Preparing metadata (setup.py) ... done
Requirement already satisfied: pandas in /opt/homebrew/lib/python3.10/site-packages (from open-cravat) (2.2.3)
Requirement already satisfied: attrs>=17.3.0 in /opt/homebrew/lib/python3.10/site-packages (from aiohttp<4.0.0->open-cravat) (22.2.0)
Requirement already satisfied: charset-normalizer<3.0,>=2.0 in /opt/homebrew/lib/python3.10/site-packages (from aiohttp<4.0.0->open-cravat) (2.1.1)
Requirement already satisfied: multidict<7.0,>=4.5 in /opt/homebrew/lib/python3.10/site-packages (from aiohttp<4.0.0->open-cravat) (6.0.4)
Requirement already satisfied: async-timeout<5.0,>=4.0.0a3 in /opt/homebrew/lib/python3.10/site-packages (from aiohttp<4.0.0->open-cravat) (4.0.2)
Requirement already satisfied: yarl<2.0,>=1.0 in /opt/homebrew/lib/python3.10/site-packages (from aiohttp<4.0.0->open-cravat) (1.8.2)
Requirement already satisfied: frozenlist>=1.1.1 in /opt/homebrew/lib/python3.10/site-packages (from aiohttp<4.0.0->open-cravat) (1.3.3)
Requirement already satisfied: aiosignal>=1.1.2 in /opt/homebrew/lib/python3.10/site-packages (from aiohttp<4.0.0->open-cravat) (1.3.1)
Requirement already satisfied: typing_extensions>=4.0 in /opt/homebrew/lib/python3.10/site-packages (from aiosqlite->open-cravat) (4.12.2)
Collecting sortedcontainers<3.0,>=2.0 (from intervaltree->open-cravat)
  Downloading sortedcontainers-2.4.0-py2.py3-none-any.whl.metadata (10 kB)
Requirement already satisfied: et-xmlfile in /opt/homebrew/lib/python3.10/site-packages (from openpyxl->open-cravat) (1.1.0)
Requirement already satisfied: numpy>=1.22.4 in /opt/homebrew/lib/python3.10/site-packages (from pandas->open-cravat) (1.26.4)
Requirement already satisfied: python-dateutil>=2.8.2 in /opt/homebrew/lib/python3.10/site-packages (from pandas->open-cravat) (2.8.2)
Requirement already satisfied: pytz>=2020.1 in /opt/homebrew/lib/python3.10/site-packages (from pandas->open-cravat) (2022.7.1)
Requirement already satisfied: tzdata>=2022.7 in /opt/homebrew/lib/python3.10/site-packages (from pandas->open-cravat) (2024.2)
Requirement already satisfied: setuptools in /opt/homebrew/lib/python3.10/site-packages (from PyVCF3->open-cravat) (75.6.0)
Requirement already satisfied: idna<4,>=2.5 in /opt/homebrew/lib/python3.10/site-packages (from requests->open-cravat) (3.4)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in /opt/homebrew/lib/python3.10/site-packages (from requests->open-cravat) (1.26.14)
Requirement already satisfied: certifi>=2017.4.17 in /opt/homebrew/lib/python3.10/site-packages (from requests->open-cravat) (2022.12.7)
Requirement already satisfied: six>=1.5 in /opt/homebrew/lib/python3.10/site-packages (from python-dateutil>=2.8.2->pandas->open-cravat) (1.17.0)
Using cached chardet-5.2.0-py3-none-any.whl (199 kB)
Downloading aiosqlite-0.20.0-py3-none-any.whl (15 kB)
Downloading oyaml-1.0-py2.py3-none-any.whl (3.0 kB)
Downloading pyliftover-0.4.1-py3-none-any.whl (12 kB)
Downloading requests_toolbelt-1.0.0-py2.py3-none-any.whl (54 kB)
Downloading websockets-14.1-cp310-cp310-macosx_11_0_arm64.whl (159 kB)
Downloading XlsxWriter-3.2.0-py3-none-any.whl (159 kB)
Downloading sortedcontainers-2.4.0-py2.py3-none-any.whl (29 kB)
Building wheels for collected packages: open-cravat, intervaltree, PyVCF3, twobitreader
  Building wheel for open-cravat (setup.py) ... done
  Created wheel for open-cravat: filename=open_cravat-2.11.1-py3-none-any.whl size=3173918 sha256=880e689b4de6900184f9933567296555fb1d58bf1bb76a12ec4c87ab7229a99b
  Stored in directory: /Users/benjamin/Library/Caches/pip/wheels/73/61/aa/6e2d33544a98aa8b43de1593471f25ea3f867453b56dedc6e7
  Building wheel for intervaltree (setup.py) ... done
  Created wheel for intervaltree: filename=intervaltree-3.1.0-py2.py3-none-any.whl size=26097 sha256=e27df3e9445c817125d65fb2ad582e1ed7ca970ae39f3ca0bcde62f74655cc50
  Stored in directory: /Users/benjamin/Library/Caches/pip/wheels/fa/80/8c/43488a924a046b733b64de3fac99252674c892a4c3801c0a61
  Building wheel for PyVCF3 (setup.py) ... done
  Created wheel for PyVCF3: filename=PyVCF3-1.0.3-py3-none-any.whl size=988536 sha256=016e15c188a906ccbfbb194b929021e4a7134cfd3011c7acece1d99850062cc7
  Stored in directory: /Users/benjamin/Library/Caches/pip/wheels/12/2e/72/c03483bc49d13b24ec16d0878e17df5e9d2cd9a088935acdda
  Building wheel for twobitreader (setup.py) ... done
  Created wheel for twobitreader: filename=twobitreader-3.1.7-py3-none-any.whl size=9584 sha256=c54ab599ab92813c5e0564c7b006e1386d308b2b2db0e9b116cd62094c3dfd35
  Stored in directory: /Users/benjamin/Library/Caches/pip/wheels/d1/4a/92/1d73e58f8e3e5eef4e59c8719a7c5c542f32804ec50dd33a58
Successfully built open-cravat intervaltree PyVCF3 twobitreader
Installing collected packages: twobitreader, sortedcontainers, pyliftover, xlsxwriter, websockets, PyVCF3, oyaml, intervaltree, chardet, aiosqlite, requests-toolbelt, open-cravat
Successfully installed PyVCF3-1.0.3 aiosqlite-0.20.0 chardet-5.2.0 intervaltree-3.1.0 open-cravat-2.11.1 oyaml-1.0 pyliftover-0.4.1 requests-toolbelt-1.0.0 sortedcontainers-2.4.0 twobitreader-3.1.7 websockets-14.1 xlsxwriter-3.2.0
benjamin@MacBook-Pro-de-Benjamin ~ % 

I still got :

benjamin@MacBook-Pro-de-Benjamin ~ % pip3 install pyvcf
Collecting pyvcf
  Using cached PyVCF-0.6.8.tar.gz (34 kB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error
  
  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [3 lines of output]
      /opt/homebrew/lib/python3.10/site-packages/setuptools/_distutils/dist.py:261: UserWarning: Unknown distribution option: 'test_suite'
        warnings.warn(msg)
      error in PyVCF setup command: use_2to3 is invalid.
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

@kmoad
Copy link
Collaborator

kmoad commented Jan 2, 2025

@BenjaminDEMAILLE I think your OpenCRAVAT install is ok. We switched to using PyVCF3 which is an actively maintained fork of PyVCF. I can see it being installed in your output from pip install open-cravat

To be sure, try running oc against a vcf file.

kyle@monolith:~$ oc new example-input --type vcf
/home/kyle/example_input.vcf
kyle@monolith:~$ oc run example_input.vcf 
Input file(s): /home/kyle/example_input.vcf
...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants