LooseLab / readfish

CLI tool for flexible and fast adaptive sampling on ONT sequencers
https://looselab.github.io/readfish/
GNU General Public License v3.0
167 stars 31 forks source link

conda installation fails in Ubuntu 22.04 #229

Closed brunoasm closed 1 year ago

brunoasm commented 1 year ago

Hi, I am trying to use the conda installation method and a consistently get an error when installing. It seems the source of the problem is the mappy dependency. Any ideas for a workaround? Maybe I am missing a system library?

This is in a brand new Ubuntu 22.04 system.

` Preparing transaction: done Verifying transaction: done Executing transaction: done Installing pip dependencies: / Ran pip subprocess with arguments: ['/home/nanoporeseq/miniconda3/envs/readfish/bin/python', '-m', 'pip', 'install', '-U', '-r', '/home/nanoporeseq/Desktop/readfish/condaenv.vspf11de.requirements.txt', '--exists-action=b'] Pip subprocess output: Collecting git+https://github.com/LooseLab/readfish@dev_staging (from -r /home/nanoporeseq/Desktop/readfish/condaenv.vspf11de.requirements.txt (line 3)) Cloning https://github.com/LooseLab/readfish (to revision dev_staging) to /tmp/pip-req-build-5ekbfoj3 Resolved https://github.com/LooseLab/readfish to commit 0ccb59324906635a0d077f94d7f82388039885cb Preparing metadata (setup.py): started Preparing metadata (setup.py): finished with status 'done' Collecting read-until==3.0.0 Using cached read_until-3.0.0-py3-none-any.whl (21 kB) Collecting ont-pyguppy-client-lib==6.4.2 Using cached ont_pyguppy_client_lib-6.4.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.9 MB) Collecting minknow-api>=4.0.4 Using cached minknow_api-5.4.0-py3-none-any.whl (322 kB) Collecting numpy==1.17.4 Using cached numpy-1.17.4-cp38-cp38-manylinux1_x86_64.whl (20.5 MB) Collecting grpcio Using cached grpcio-1.51.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.8 MB) Collecting requests Using cached requests-2.28.2-py3-none-any.whl (62 kB) Collecting google Using cached google-3.0.0-py2.py3-none-any.whl (45 kB) Collecting protobuf Using cached protobuf-4.21.12-cp37-abi3-manylinux2014_x86_64.whl (409 kB) Collecting toml Using cached toml-0.10.2-py2.py3-none-any.whl (16 kB) Collecting jsonschema Using cached jsonschema-4.17.3-py3-none-any.whl (90 kB) Collecting watchdog Using cached watchdog-2.2.1-py3-none-manylinux2014_x86_64.whl (78 kB) Collecting pandas Using cached pandas-1.5.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (12.2 MB) Collecting mappy Using cached mappy-2.24.tar.gz (140 kB) Preparing metadata (setup.py): started Preparing metadata (setup.py): finished with status 'done' Collecting biopython==1.76 Using cached biopython-1.76-cp38-cp38-manylinux1_x86_64.whl (2.3 MB) Collecting packaging>=15.0 Using cached packaging-23.0-py3-none-any.whl (42 kB) Collecting protobuf Using cached protobuf-3.20.3-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl (1.0 MB) Collecting pyrfc3339~=1.1 Using cached pyRFC3339-1.1-py2.py3-none-any.whl (5.7 kB) Collecting beautifulsoup4 Using cached beautifulsoup4-4.11.2-py3-none-any.whl (129 kB) Collecting attrs>=17.4.0 Using cached attrs-22.2.0-py3-none-any.whl (60 kB) Collecting pyrsistent!=0.17.0,!=0.17.1,!=0.17.2,>=0.14.0 Using cached pyrsistent-0.19.3-py3-none-any.whl (57 kB) Collecting importlib-resources>=1.4.0 Using cached importlib_resources-5.10.2-py3-none-any.whl (34 kB) Collecting pkgutil-resolve-name>=1.3.10 Using cached pkgutil_resolve_name-1.3.10-py3-none-any.whl (4.7 kB) Collecting pandas Using cached pandas-1.5.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (12.2 MB) Using cached pandas-1.5.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (12.2 MB) Using cached pandas-1.5.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (12.2 MB) Using cached pandas-1.4.4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (11.7 MB) Using cached pandas-1.4.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (11.7 MB) Using cached pandas-1.4.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (11.7 MB) Using cached pandas-1.4.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (11.7 MB) Using cached pandas-1.4.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (11.7 MB) Using cached pandas-1.3.5-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (11.5 MB) Collecting python-dateutil>=2.7.3 Using cached python_dateutil-2.8.2-py2.py3-none-any.whl (247 kB) Collecting pytz>=2017.3 Using cached pytz-2022.7.1-py2.py3-none-any.whl (499 kB) Collecting urllib3<1.27,>=1.21.1 Using cached urllib3-1.26.14-py2.py3-none-any.whl (140 kB) Collecting certifi>=2017.4.17 Using cached certifi-2022.12.7-py3-none-any.whl (155 kB) Collecting idna<4,>=2.5 Using cached idna-3.4-py3-none-any.whl (61 kB) Collecting charset-normalizer<4,>=2 Using cached charset_normalizer-3.0.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (195 kB) Collecting zipp>=3.1.0 Downloading zipp-3.12.1-py3-none-any.whl (6.7 kB) Collecting six>=1.5 Using cached six-1.16.0-py2.py3-none-any.whl (11 kB) Collecting soupsieve>1.2 Using cached soupsieve-2.3.2.post1-py3-none-any.whl (37 kB) Building wheels for collected packages: readfish, mappy Building wheel for readfish (setup.py): started Building wheel for readfish (setup.py): finished with status 'done' Created wheel for readfish: filename=readfish-0.0.11a3-py3-none-any.whl size=63745 sha256=2fee55cc62c8a5bd866cc24d80e5b13a8e7a744b58fa96c0b2af63f864cd12ff Stored in directory: /tmp/pip-ephem-wheel-cache-b7jjs3yb/wheels/1a/97/bb/de94dd3c43383aac9fb7f85f3827eaadb914eded55bf20cc8c Building wheel for mappy (setup.py): started Building wheel for mappy (setup.py): finished with status 'error' Running setup.py clean for mappy Successfully built readfish Failed to build mappy Installing collected packages: pytz, mappy, charset-normalizer, zipp, watchdog, urllib3, toml, soupsieve, six, pyrsistent, pyrfc3339, protobuf, pkgutil-resolve-name, packaging, numpy, idna, grpcio, certifi, attrs, requests, python-dateutil, ont-pyguppy-client-lib, minknow-api, importlib-resources, biopython, beautifulsoup4, read-until, pandas, jsonschema, google, readfish Running setup.py install for mappy: started Running setup.py install for mappy: finished with status 'error'

Pip subprocess error: Running command git clone --filter=blob:none --quiet https://github.com/LooseLab/readfish /tmp/pip-req-build-5ekbfoj3 error: subprocess-exited-with-error

× python setup.py bdist_wheel did not run successfully. │ exit code: 1 ╰─> [34 lines of output] /home/nanoporeseq/miniconda3/envs/readfish/lib/python3.8/site-packages/setuptools/installer.py:27: SetuptoolsDeprecationWarning: setuptools.installer is deprecated. Requirements should be satisfied by a PEP 517 installer. warnings.warn( running bdist_wheel running build running build_ext cythoning python/mappy.pyx to python/mappy.c /tmp/pip-install-c3ck897k/mappy_0ca31c7ccd364d2e9a683981f0bed2a5/.eggs/Cython-0.29.33-py3.8-linux-x86_64.egg/Cython/Compiler/Main.py:369: FutureWarning: Cython directive 'language_level' not set, using 2 for now (Py2). This will change in a later release! File: /tmp/pip-install-c3ck897k/mappy_0ca31c7ccd364d2e9a683981f0bed2a5/python/mappy.pyx tree = Parsing.p_module(s, pxd, full_module_name) building 'mappy' extension creating build creating build/temp.linux-x86_64-cpython-38 creating build/temp.linux-x86_64-cpython-38/python gcc -pthread -B /home/nanoporeseq/miniconda3/envs/readfish/compiler_compat -Wno-unused-result -Wsign-compare -DNDEBUG -fwrapv -O2 -Wall -fPIC -O2 -isystem /home/nanoporeseq/miniconda3/envs/readfish/include -fPIC -O2 -isystem /home/nanoporeseq/miniconda3/envs/readfish/include -fPIC -I. -I/home/nanoporeseq/miniconda3/envs/readfish/include/python3.8 -c align.c -o build/temp.linux-x86_64-cpython-38/align.o -DHAVE_KALLOC -msse4.1 align.c: In function ‘mm_get_hplen_back’: align.c:349:43: warning: comparison of integer expressions of different signedness: ‘uint32_t’ {aka ‘unsigned int’} and ‘int’ [-Wsign-compare] 349 | if (mm_seq4_get(mi->S, i) != c) break; | ^~ align.c: In function ‘mm_seed_ext_score’: align.c:536:56: warning: operand of ‘?:’ changes signedness from ‘int’ to ‘uint32_t’ {aka ‘unsigned int’} due to unsignedness of other operand [-Wsign-compare] 536 | re = re + ext_len < (int32_t)mi->seq[rid].len? re + ext_len : mi->seq[rid].len; | ^~~~ align.c: In function ‘mm_align1’: align.c:630:59: warning: operand of ‘?:’ changes signedness from ‘int32_t’ {aka ‘int’} to ‘uint32_t’ {aka ‘unsigned int’} due to unsignedness of other operand [-Wsign-compare] 630 | re0 = re + l < (int32_t)mi->seq[rid].len? re + l : mi->seq[rid].len; | ^~ align.c:682:65: warning: operand of ‘?:’ changes signedness from ‘int32_t’ {aka ‘int’} to ‘uint32_t’ {aka ‘unsigned int’} due to unsignedness of other operand [-Wsign-compare] 682 | l = l < (int32_t)mi->seq[rid].len - re? l : mi->seq[rid].len - re; | ^ gcc -pthread -B /home/nanoporeseq/miniconda3/envs/readfish/compiler_compat -Wno-unused-result -Wsign-compare -DNDEBUG -fwrapv -O2 -Wall -fPIC -O2 -isystem /home/nanoporeseq/miniconda3/envs/readfish/include -fPIC -O2 -isystem /home/nanoporeseq/miniconda3/envs/readfish/include -fPIC -I. -I/home/nanoporeseq/miniconda3/envs/readfish/include/python3.8 -c bseq.c -o build/temp.linux-x86_64-cpython-38/bseq.o -DHAVE_KALLOC -msse4.1 bseq.c:1:10: fatal error: zlib.h: No such file or directory 1 | #include | ^~~~ compilation terminated. error: command '/usr/bin/gcc' failed with exit code 1 [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for mappy error: subprocess-exited-with-error

× Running setup.py install for mappy did not run successfully. │ exit code: 1 ╰─> [34 lines of output] /home/nanoporeseq/miniconda3/envs/readfish/lib/python3.8/site-packages/setuptools/installer.py:27: SetuptoolsDeprecationWarning: setuptools.installer is deprecated. Requirements should be satisfied by a PEP 517 installer. warnings.warn( running install /home/nanoporeseq/miniconda3/envs/readfish/lib/python3.8/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools. warnings.warn( running build running build_ext skipping 'python/mappy.c' Cython extension (up-to-date) building 'mappy' extension creating build creating build/temp.linux-x86_64-cpython-38 creating build/temp.linux-x86_64-cpython-38/python gcc -pthread -B /home/nanoporeseq/miniconda3/envs/readfish/compiler_compat -Wno-unused-result -Wsign-compare -DNDEBUG -fwrapv -O2 -Wall -fPIC -O2 -isystem /home/nanoporeseq/miniconda3/envs/readfish/include -fPIC -O2 -isystem /home/nanoporeseq/miniconda3/envs/readfish/include -fPIC -I. -I/home/nanoporeseq/miniconda3/envs/readfish/include/python3.8 -c align.c -o build/temp.linux-x86_64-cpython-38/align.o -DHAVE_KALLOC -msse4.1 align.c: In function ‘mm_get_hplen_back’: align.c:349:43: warning: comparison of integer expressions of different signedness: ‘uint32_t’ {aka ‘unsigned int’} and ‘int’ [-Wsign-compare] 349 | if (mm_seq4_get(mi->S, i) != c) break; | ^~ align.c: In function ‘mm_seed_ext_score’: align.c:536:56: warning: operand of ‘?:’ changes signedness from ‘int’ to ‘uint32_t’ {aka ‘unsigned int’} due to unsignedness of other operand [-Wsign-compare] 536 | re = re + ext_len < (int32_t)mi->seq[rid].len? re + ext_len : mi->seq[rid].len; | ^~~~ align.c: In function ‘mm_align1’: align.c:630:59: warning: operand of ‘?:’ changes signedness from ‘int32_t’ {aka ‘int’} to ‘uint32_t’ {aka ‘unsigned int’} due to unsignedness of other operand [-Wsign-compare] 630 | re0 = re + l < (int32_t)mi->seq[rid].len? re + l : mi->seq[rid].len; | ^~ align.c:682:65: warning: operand of ‘?:’ changes signedness from ‘int32_t’ {aka ‘int’} to ‘uint32_t’ {aka ‘unsigned int’} due to unsignedness of other operand [-Wsign-compare] 682 | l = l < (int32_t)mi->seq[rid].len - re? l : mi->seq[rid].len - re; | ^ gcc -pthread -B /home/nanoporeseq/miniconda3/envs/readfish/compiler_compat -Wno-unused-result -Wsign-compare -DNDEBUG -fwrapv -O2 -Wall -fPIC -O2 -isystem /home/nanoporeseq/miniconda3/envs/readfish/include -fPIC -O2 -isystem /home/nanoporeseq/miniconda3/envs/readfish/include -fPIC -I. -I/home/nanoporeseq/miniconda3/envs/readfish/include/python3.8 -c bseq.c -o build/temp.linux-x86_64-cpython-38/bseq.o -DHAVE_KALLOC -msse4.1 bseq.c:1:10: fatal error: zlib.h: No such file or directory 1 | #include | ^~~~ compilation terminated. error: command '/usr/bin/gcc' failed with exit code 1 [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. error: legacy-install-failure

× Encountered error while trying to install package. ╰─> mappy

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

failed

CondaEnvException: Pip failed `

alexomics commented 1 year ago

This error is because you are missing the zlib.h file. Installing it using apt should resolve this:

sudo apt install zlib1g-dev
brunoasm commented 1 year ago

Thanks, it works now!