daler / pybedtools

Python wrapper -- and more -- for BEDTools (bioinformatics tools for "genome arithmetic")
http://daler.github.io/pybedtools
Other
297 stars 103 forks source link

Unable to install pybedtools==0.9.1 in Python3.10 #398

Closed romunov closed 3 months ago

romunov commented 7 months ago

Can anyone reproduce this?

$ mkvirtualenv test --python=python3.10
created virtual environment CPython3.10.13.final.0-64 in 165ms
  creator CPython3Posix(dest=/home/romunov/.virtualenvs/test, clear=False, no_vcs_ignore=False, global=False)
  seeder FromAppData(extra_search_dir=/usr/share/python-wheels,download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=/home/romunov/.local/share/virtualenv)
    added seed packages: pip==23.1.2, setuptools==67.7.2, wheel==0.40.0
  activators BashActivator,CShellActivator,FishActivator,NushellActivator,PowerShellActivator,PythonActivator
...
(test) [13:35:03] romunov:~$
$ pip install pybedtools
Collecting pybedtools
  Using cached pybedtools-0.9.1.tar.gz (12.5 MB)
  Preparing metadata (setup.py) ... done
Collecting six (from pybedtools)
  Using cached six-1.16.0-py2.py3-none-any.whl (11 kB)
Collecting pysam (from pybedtools)
  Downloading pysam-0.22.0-cp310-cp310-manylinux_2_28_x86_64.whl (21.9 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 21.9/21.9 MB 11.6 MB/s eta 0:00:00
Collecting numpy (from pybedtools)
  Using cached numpy-1.26.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (18.2 MB)
Building wheels for collected packages: pybedtools
  Building wheel for pybedtools (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [187 lines of output]
      /home/romunov/.virtualenvs/test/lib/python3.10/site-packages/setuptools/_distutils/dist.py:265: UserWarning: Unknown distribution option: 'language_level'
        warnings.warn(msg)
      running bdist_wheel
      The [wheel] section is deprecated. Use [bdist_wheel] instead.
      running build
      running build_py
      creating build
      creating build/lib.linux-x86_64-cpython-310
      creating build/lib.linux-x86_64-cpython-310/pybedtools
      copying pybedtools/version.py -> build/lib.linux-x86_64-cpython-310/pybedtools
      copying pybedtools/stats.py -> build/lib.linux-x86_64-cpython-310/pybedtools
      copying pybedtools/settings.py -> build/lib.linux-x86_64-cpython-310/pybedtools
      copying pybedtools/paths.py -> build/lib.linux-x86_64-cpython-310/pybedtools
      copying pybedtools/parallel.py -> build/lib.linux-x86_64-cpython-310/pybedtools
      copying pybedtools/logger.py -> build/lib.linux-x86_64-cpython-310/pybedtools
      copying pybedtools/helpers.py -> build/lib.linux-x86_64-cpython-310/pybedtools
      copying pybedtools/genome_registry.py -> build/lib.linux-x86_64-cpython-310/pybedtools
      copying pybedtools/filenames.py -> build/lib.linux-x86_64-cpython-310/pybedtools
      copying pybedtools/bedtool.py -> build/lib.linux-x86_64-cpython-310/pybedtools
      copying pybedtools/__init__.py -> build/lib.linux-x86_64-cpython-310/pybedtools
      creating build/lib.linux-x86_64-cpython-310/pybedtools/test
      copying pybedtools/test/tfuncs.py -> build/lib.linux-x86_64-cpython-310/pybedtools/test
      copying pybedtools/test/test_pathlib.py -> build/lib.linux-x86_64-cpython-310/pybedtools/test
      copying pybedtools/test/test_len_leak.py -> build/lib.linux-x86_64-cpython-310/pybedtools/test
      copying pybedtools/test/test_iter.py -> build/lib.linux-x86_64-cpython-310/pybedtools/test
      copying pybedtools/test/test_issues.py -> build/lib.linux-x86_64-cpython-310/pybedtools/test
      copying pybedtools/test/test_helpers.py -> build/lib.linux-x86_64-cpython-310/pybedtools/test
      copying pybedtools/test/test_gzip_support.py -> build/lib.linux-x86_64-cpython-310/pybedtools/test
      copying pybedtools/test/test_contrib.py -> build/lib.linux-x86_64-cpython-310/pybedtools/test
      copying pybedtools/test/test_cbedtools.py -> build/lib.linux-x86_64-cpython-310/pybedtools/test
      copying pybedtools/test/test_1.py -> build/lib.linux-x86_64-cpython-310/pybedtools/test
      copying pybedtools/test/regression_tests.py -> build/lib.linux-x86_64-cpython-310/pybedtools/test
      copying pybedtools/test/genomepy_integration.py -> build/lib.linux-x86_64-cpython-310/pybedtools/test
      copying pybedtools/test/__init__.py -> build/lib.linux-x86_64-cpython-310/pybedtools/test
      creating build/lib.linux-x86_64-cpython-310/pybedtools/contrib
      copying pybedtools/contrib/venn_maker.py -> build/lib.linux-x86_64-cpython-310/pybedtools/contrib
      copying pybedtools/contrib/plotting.py -> build/lib.linux-x86_64-cpython-310/pybedtools/contrib
      copying pybedtools/contrib/long_range_interaction.py -> build/lib.linux-x86_64-cpython-310/pybedtools/contrib
      copying pybedtools/contrib/intersection_matrix.py -> build/lib.linux-x86_64-cpython-310/pybedtools/contrib
      copying pybedtools/contrib/bigwig.py -> build/lib.linux-x86_64-cpython-310/pybedtools/contrib
      copying pybedtools/contrib/bigbed.py -> build/lib.linux-x86_64-cpython-310/pybedtools/contrib
      copying pybedtools/contrib/__init__.py -> build/lib.linux-x86_64-cpython-310/pybedtools/contrib
      creating build/lib.linux-x86_64-cpython-310/pybedtools/test/data
      copying pybedtools/test/data/__init__.py -> build/lib.linux-x86_64-cpython-310/pybedtools/test/data
      running egg_info
      creating pybedtools.egg-info
      writing pybedtools.egg-info/PKG-INFO
      writing dependency_links to pybedtools.egg-info/dependency_links.txt
      writing requirements to pybedtools.egg-info/requires.txt
      writing top-level names to pybedtools.egg-info/top_level.txt
      writing manifest file 'pybedtools.egg-info/SOURCES.txt'
      reading manifest file 'pybedtools.egg-info/SOURCES.txt'
      adding license file 'LICENSE.txt'
...
      creating build/temp.linux-x86_64-cpython-310/pybedtools/include
      gcc -Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fPIC -Ipybedtools/include/ -I/home/romunov/.virtualenvs/test/include -I/usr/include/python3.10 -c pybedtools/cbedtools.cpp -o build/temp.linux-x86_64-cpython-310/pybedtools/cbedtools.o
      pybedtools/cbedtools.cpp:35:10: fatal error: Python.h: No such file or directory
         35 | #include "Python.h"
            |          ^~~~~~~~~~
      compilation terminated.
      error: command '/usr/lib64/ccache/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 pybedtools
  Running setup.py clean for pybedtools
  error: subprocess-exited-with-error

  × python setup.py clean did not run successfully.
  │ exit code: 1
  ╰─> [8 lines of output]
      /home/romunov/.virtualenvs/test/lib/python3.10/site-packages/setuptools/_distutils/dist.py:265: UserWarning: Unknown distribution option: 'language_level'
        warnings.warn(msg)
      usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
         or: setup.py --help [cmd1 cmd2 ...]
         or: setup.py --help-commands
         or: setup.py cmd --help

      error: option --all not recognized
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed cleaning build dir for pybedtools
Failed to build pybedtools
ERROR: Could not build wheels for pybedtools, which is required to install pyproject.toml-based projects

Version 0.9.0 goes through.

$ pip install pybedtools==0.9.0
Collecting pybedtools==0.9.0
  Using cached pybedtools-0.9.0-cp310-cp310-linux_x86_64.whl
Collecting six (from pybedtools==0.9.0)
  Using cached six-1.16.0-py2.py3-none-any.whl (11 kB)
Collecting pysam (from pybedtools==0.9.0)
  Using cached pysam-0.22.0-cp310-cp310-manylinux_2_28_x86_64.whl (21.9 MB)
Installing collected packages: six, pysam, pybedtools
Successfully installed pybedtools-0.9.0 pysam-0.22.0 six-1.16.0
glenncarson commented 6 months ago

@romunov I'm also getting a failed wheel build. Interestingly, I'm seeing the issue for 0.9.1 and 0.9.0.

Edit: The issue was the version of gcc I was using in my HPC environment.

romunov commented 5 months ago

My gcc version is

$ gcc --version
gcc (GCC) 13.2.1 20231011 (Red Hat 13.2.1-4)
daler commented 3 months ago

Any luck with v0.10.0? Based on the errors above, looks like you need the Python dev library installed (e.g., apt install python-dev on Ubuntu). Please re-open though if that does not resolve the issue!

romunov commented 3 months ago

Work on Fedora, Python 3.11. python-devel for 3.11 is installed.

$ mkvirtualenv pybed --python=3.11
...
(pybed) [13:45:58] romunov:~$
$ pip install pybedtools
Collecting pybedtools
  Using cached pybedtools-0.10.0.tar.gz (12.6 MB)
  Preparing metadata (setup.py) ... done
Collecting pysam (from pybedtools)
  Downloading pysam-0.22.0-cp311-cp311-manylinux_2_28_x86_64.whl.metadata (1.5 kB)
Collecting numpy (from pybedtools)
  Using cached numpy-1.26.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (61 kB)
Using cached numpy-1.26.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (18.3 MB)
Downloading pysam-0.22.0-cp311-cp311-manylinux_2_28_x86_64.whl (25.1 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 25.1/25.1 MB 6.0 MB/s eta 0:00:00
Building wheels for collected packages: pybedtools
  Building wheel for pybedtools (setup.py) ... done
  Created wheel for pybedtools: filename=pybedtools-0.10.0-cp311-cp311-linux_x86_64.whl size=14264964 sha256=aacc60faf06aecf79f6885119fa3de9c5ad96905f5f7f95fb6370eb9bc9f76af
  Stored in directory: /home/romunov/.cache/pip/wheels/99/09/f0/681320279aa6dcbc1cedd5503c385e9eb38a2b4531dd8d4680
Successfully built pybedtools
Installing collected packages: pysam, numpy, pybedtools
Successfully installed numpy-1.26.4 pybedtools-0.10.0 pysam-0.22.0

[notice] A new release of pip is available: 23.3.2 -> 24.0
[notice] To update, run: pip install --upgrade pip