brentp / cyvcf2

cython + htslib == fast VCF and BCF processing
MIT License
381 stars 72 forks source link

Windows 11 Installing Issue #243

Open genewater opened 2 years ago

genewater commented 2 years ago

I cannot install somehow cyvcf2. I upgraded to python 3.9.x and also updated visual studio.


Running setup.py install for cyvcf2 ... error
  error: subprocess-exited-with-error

  × Running setup.py install for cyvcf2 did not run successfully.
  │ exit code: 1
  ╰─> [72 lines of output]
      running install
      running build
      running build_py
      creating build
      creating build\lib.win-amd64-3.9
      creating build\lib.win-amd64-3.9\cyvcf2
      copying cyvcf2\cli.py -> build\lib.win-amd64-3.9\cyvcf2
      copying cyvcf2\__init__.py -> build\lib.win-amd64-3.9\cyvcf2
      copying cyvcf2\__main__.py -> build\lib.win-amd64-3.9\cyvcf2
      creating build\lib.win-amd64-3.9\cyvcf2\tests
      copying cyvcf2\tests\test_cli.py -> build\lib.win-amd64-3.9\cyvcf2\tests
      copying cyvcf2\tests\test_hemi.py -> build\lib.win-amd64-3.9\cyvcf2\tests
      copying cyvcf2\tests\test_reader.py -> build\lib.win-amd64-3.9\cyvcf2\tests
      copying cyvcf2\tests\test_writer.py -> build\lib.win-amd64-3.9\cyvcf2\tests
      copying cyvcf2\tests\__init__.py -> build\lib.win-amd64-3.9\cyvcf2\tests
      running egg_info
      writing cyvcf2.egg-info\PKG-INFO
      writing dependency_links to cyvcf2.egg-info\dependency_links.txt
      writing entry points to cyvcf2.egg-info\entry_points.txt
      writing requirements to cyvcf2.egg-info\requires.txt
      writing top-level names to cyvcf2.egg-info\top_level.txt
      reading manifest file 'cyvcf2.egg-info\SOURCES.txt'
      reading manifest template 'MANIFEST.in'
      adding license file 'LICENSE'
      writing manifest file 'cyvcf2.egg-info\SOURCES.txt'
      copying cyvcf2\cyvcf2.c -> build\lib.win-amd64-3.9\cyvcf2
      copying cyvcf2\cyvcf2.pxd -> build\lib.win-amd64-3.9\cyvcf2
      copying cyvcf2\cyvcf2.pyx -> build\lib.win-amd64-3.9\cyvcf2
      copying cyvcf2\helpers.c -> build\lib.win-amd64-3.9\cyvcf2
      copying cyvcf2\helpers.h -> build\lib.win-amd64-3.9\cyvcf2
      copying cyvcf2\relatedness.h -> build\lib.win-amd64-3.9\cyvcf2
      copying cyvcf2\tests\bug.vcf.gz -> build\lib.win-amd64-3.9\cyvcf2\tests
      copying cyvcf2\tests\decomposed.vcf -> build\lib.win-amd64-3.9\cyvcf2\tests
      copying cyvcf2\tests\empty.vcf -> build\lib.win-amd64-3.9\cyvcf2\tests
      copying cyvcf2\tests\issue_198.vcf -> build\lib.win-amd64-3.9\cyvcf2\tests
      copying cyvcf2\tests\issue_44.vcf -> build\lib.win-amd64-3.9\cyvcf2\tests
      copying cyvcf2\tests\no-seq-len.vcf -> build\lib.win-amd64-3.9\cyvcf2\tests
      copying cyvcf2\tests\no-seq-names.vcf -> build\lib.win-amd64-3.9\cyvcf2\tests
      copying cyvcf2\tests\o.vcf.gz -> build\lib.win-amd64-3.9\cyvcf2\tests
      copying cyvcf2\tests\seg.vcf.gz -> build\lib.win-amd64-3.9\cyvcf2\tests
      copying cyvcf2\tests\test-alt-repr.vcf -> build\lib.win-amd64-3.9\cyvcf2\tests
      copying cyvcf2\tests\test-diff.csi -> build\lib.win-amd64-3.9\cyvcf2\tests
      copying cyvcf2\tests\test-format-string.vcf -> build\lib.win-amd64-3.9\cyvcf2\tests
      copying cyvcf2\tests\test-genotypes.vcf -> build\lib.win-amd64-3.9\cyvcf2\tests
      copying cyvcf2\tests\test-haploidX.vcf -> build\lib.win-amd64-3.9\cyvcf2\tests
      copying cyvcf2\tests\test-hemi.vcf -> build\lib.win-amd64-3.9\cyvcf2\tests
      copying cyvcf2\tests\test-invalid-header.vcf -> build\lib.win-amd64-3.9\cyvcf2\tests
      copying cyvcf2\tests\test-multiallelic-homozygous-alt.vcf.gz -> build\lib.win-amd64-3.9\cyvcf2\tests
      copying cyvcf2\tests\test-multiallelic-homozygous-alt.vcf.gz.tbi -> build\lib.win-amd64-3.9\cyvcf2\tests
      copying cyvcf2\tests\test-strict-gt-option-flag.vcf.gz -> build\lib.win-amd64-3.9\cyvcf2\tests
      copying cyvcf2\tests\test-strict-gt-option-flag.vcf.gz.tbi -> build\lib.win-amd64-3.9\cyvcf2\tests
      copying cyvcf2\tests\test.bug.117.vcf -> build\lib.win-amd64-3.9\cyvcf2\tests
      copying cyvcf2\tests\test.comp_het.3.vcf -> build\lib.win-amd64-3.9\cyvcf2\tests
      copying cyvcf2\tests\test.isa.vcf -> build\lib.win-amd64-3.9\cyvcf2\tests
      copying cyvcf2\tests\test.mnp.vcf -> build\lib.win-amd64-3.9\cyvcf2\tests
      copying cyvcf2\tests\test.snpeff.bcf -> build\lib.win-amd64-3.9\cyvcf2\tests
      copying cyvcf2\tests\test.snpeff.bcf.csi -> build\lib.win-amd64-3.9\cyvcf2\tests
      copying cyvcf2\tests\test.snpeff.vcf -> build\lib.win-amd64-3.9\cyvcf2\tests
      copying cyvcf2\tests\test.vcf.gz -> build\lib.win-amd64-3.9\cyvcf2\tests
      copying cyvcf2\tests\test.vcf.gz.tbi -> build\lib.win-amd64-3.9\cyvcf2\tests
      copying cyvcf2\tests\test_gt_alt_freqs.vcf -> build\lib.win-amd64-3.9\cyvcf2\tests
      copying cyvcf2\tests\test_gt_bases.vcf.gz -> build\lib.win-amd64-3.9\cyvcf2\tests
      running build_ext
      building 'cyvcf2.cyvcf2' extension
      creating build\temp.win-amd64-3.9
      creating build\temp.win-amd64-3.9\Release
      creating build\temp.win-amd64-3.9\Release\cyvcf2
      creating build\temp.win-amd64-3.9\Release\htslib
      creating build\temp.win-amd64-3.9\Release\htslib\cram
      C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.28.29333\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Ihtslib -Icyvcf2 -IC:\Users\Nishit\AppData\Local\Programs\Python\Python39\lib\si
te-packages\numpy\core\include -IC:\Users\Nishit\AppData\Local\Programs\Python\Python39\include -IC:\Users\Nishit\AppData\Local\Programs\Python\Python39\include -IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\
MSVC\14.28.29333\include -IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt -IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared -IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um -IC:\Prog
ram Files (x86)\Windows Kits\10\include\10.0.18362.0\winrt -IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\cppwinrt /Tccyvcf2/cyvcf2.c /Fobuild\temp.win-amd64-3.9\Release\cyvcf2/cyvcf2.obj -Wno-sign-compare -Wno-unused-fu
nction -Wno-strict-prototypes -Wno-unused-result -Wno-discarded-qualifiers
      cl : Befehlszeile error D8021 : Ung\x81ltiges numerisches Argument /Wno-sign-compare.
      error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.28.29333\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
      [end of output]
empathy-c commented 1 year ago

I also meet this problem. I must use cyvcf2-0.20.0,but I try many methods stil cannot install successfully. Have you solved it?

brentp commented 1 year ago

Hi @empathy-c sorry for the troubles, indeed we're having difficulty with the builds. I would suggest to use bioconda to get that version.

empathy-c commented 1 year ago

But in bioconda I can only install the version 0.30.2 which is the lastest. But when I use MetaXcan to do some TWAS analysis,the project need cyvcf2=0.20.0. I have installed cyvcf2-0.30.2 by using whl to pip ,but the project still not work,so i think maybe I need to install the version of 0.20.0. But cyvcf2-0.20.0 not have whl

empathy-c commented 1 year ago

When I use pip install cyvcf2==0.20.0 in linux(it has installed python3.10),error shows:python setup.py bdist_wheel did not run successfully. exit code: 1 /root/anaconda3/lib/python3.10/distutils/dist.py:274: UserWarning: Unknown distribution option: 'long_description_content_type' ERROR: Failed building wheel for cyvcf2 Running setup.py clean for cyvcf2 Failed to build cyvcf2 ERROR: Could not build wheels for cyvcf2, which is required to install pyproject.toml-based projects And I download cyvcf2-0.20.0.tar.gz and use local install by print:python setup.py install in linux,errors show: Cyvcf2/cyvcf2. c: In the function '_ Pyx TP Dealloc 6cyvcf2 6cyvcf2 In VCF ':

Cyvcf2/cyvcf2. c: 57897:5: Error: Autoincrement operand must be an lvalue

++Py_ REFCNT (o);

^

Cyvcf2/cyvcf2. c: 57899:5: Error: The self subtraction operand must be an lvalue

--Py_ REFCNT (o);

^

Cyvcf2/cyvcf2. c: In the function '_ Pyx TP Dealloc 6cyvcf2 6cyvcf2 In Genotypes:

Cyvcf2/cyvcf2. c: 58263:5: Error: Autoincrement operand must be an lvalue

++Py_ REFCNT (o);

^

Cyvcf2/cyvcf2. c: 58265:5: Error: The self subtraction operand must be an lvalue

--Py_ REFCNT (o);

^

Cyvcf2/cyvcf2. c: In the function '_ Pyx TP Dealloc 6cyvcf2 6cyvcf2 In 'Variant':

Cyvcf2/cyvcf2. c: 58420:5: Error: Autoincrement operand must be an lvalue

++Py_ REFCNT (o);

^

Cyvcf2/cyvcf2. c: 58422:5: Error: The self subtraction operand must be an lvalue

--Py_ REFCNT (o);

^

Cyvcf2/cyvcf2. c: In the function '_ Pyx TP Dealloc 6cyvcf2 6cyvcf2 In HREC ':

Cyvcf2/cyvcf2. c: 58838:5: Error: Autoincrement operand must be an lvalue

++Py_ REFCNT (o);

^

Cyvcf2/cyvcf2. c: 58840:5: Error: The self subtraction operand must be an lvalue

--Py_ REFCNT (o);

^

Cyvcf2/cyvcf2. c: In the function '_ Pyx TP Dealloc In 'array':

Cyvcf2/cyvcf2. c: 60333:5: Error: Autoincrement operand must be an lvalue

++Py_ REFCNT (o);

^

Cyvcf2/cyvcf2. c: 60335:5: Error: The self subtraction operand must be an lvalue

--Py_ REFCNT (o);

^

Cyvcf2/cyvcf2. c: In the function '_ Pyx TP Dealloc In 'memoryview':

Cyvcf2/cyvcf2. c: 60644:5: Error: Autoincrement operand must be an lvalue

++Py_ REFCNT (o);

^

Cyvcf2/cyvcf2. c: 60646:5: Error: The self subtraction operand must be an lvalue

--Py_ REFCNT (o);

^

Cyvcf2/cyvcf2. c: In the function ' Pyx TP Dealloc In 'memoryviewslice':

Cyvcf2/cyvcf2. c: 60894:5: Error: Autoincrement operand must be an lvalue

++Py_ REFCNT (o);

^

Cyvcf2/cyvcf2. c: 60896:5: Error: The self subtraction operand must be an lvalue

--Py_ REFCNT (o); error: command '/usr/bin/gcc' failed with exit code 1 I have tried so many methods but still didnot solve it.

brentp commented 1 year ago

Hi, you are using an old version of cyvcf2 on a new version of python. So you'll have to use an old version of python to do this. Also note this in the changelog from 0.20.0: https://github.com/brentp/cyvcf2/commit/f198f661be582d00c55b633192a018a20e845712

empathy-c commented 1 year ago

OK I will try to use an old version of python to solve it. Thank you for your help!