deeptools / pyBigWig

A python extension for quick access to bigWig and bigBed files
MIT License
218 stars 49 forks source link

Failure to install pyBigWig package in python3.8-buster container when numpy is installed #106

Closed blaiseli closed 4 years ago

blaiseli commented 4 years ago

I'm using Debian-based Docker images as a basis to build Singularity containers that include some python packages, among which pyBigWig.

After trying to upgrade from 3.7-buster to 3.8-buster, the installation of pyBigWig now fails to build its C extension.

I managed to simplify the container definition file as follows:

$ cat test.def
Bootstrap:docker
From:python:3.8-buster

%post
        apt-get -y update

        # To use the "local" python, not the system one.
        export PATH="/usr/local/bin":$PATH
        # To avoid using python things installed in the HOME of root
        # (that will be mounted during singularity build)
        export PYTHONNOUSERSITE=1
        pip3 install --upgrade pip
        pip3 install numpy
        # Failure to install if numpy is installed and using python 3.8
        pip3 install pyBigWig

The build (sudo singularity build test test.def) fails with the following error:

    running build_ext
    building 'pyBigWig' extension
    Warning: Can't read registry to find the necessary compiler setting
    Make sure that Python modules winreg, win32api or win32con are installed.
    C compiler: gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC

    creating build/temp.linux-x86_64-3.8
    creating build/temp.linux-x86_64-3.8/libBigWig
    compile options: '-DWITHNUMPY -DNPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION -IlibBigWig -I/usr/local/include/python3.8 -I/usr/local/lib/python3.8/site-packages/numpy/core/include -I/usr/local/include/python3.8 -c'
    error: [Errno 2] No such file or directory
    ----------------------------------------
ERROR: Command errored out with exit status 1: /usr/local/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-dcfwpaxd/pybigwig/setup.py'"'"'; __file__='"'"'/tmp/pip-install-dcfwpaxd/pybigwig/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code
=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-59r1owcs/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.8/pyBigWig Check the logs for full comman
d output.

The "Make sure that Python modules winreg, win32api or win32con are installed." message is particularly puzzling.

The build is successful if I either use 3.7-buster instead of 3.8-buster or install pyBigWig without first installing numpy.

I don't know whether this is a Docker image issue or a pyBigWig issue so I will file an issue at both projects (see https://github.com/docker-library/python/issues/519) .

dpryan79 commented 4 years ago

Odd, this works fine with numpy and python 3.8 in bioconda (including in the busybox docker containers we use there). Given that this would seem to be a problem with the container.