You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is easy to work around, and most people probably won't ever encounter this -- I assume most installations of MACS2 are in an existing Python environment that already includes NumPy. It's easy to hit this when building a Docker image though, with the common practice of creating a requirements.txt file, COPYing that to the container, then running pip install -r requirements.txt.
In any case, this should probably either be fixed or the installation instructions should be modified. (It's also more accurate to say "pip will install NumPy automatically ..." instead of "PyPI ..." if modifying those instructions.)
To Reproduce
$ docker run -it --rm python:3 /bin/bash
root@e8aafde9f328:/# pip install MACS2==2.2.6
Collecting MACS2==2.2.6
Downloading MACS2-2.2.6.tar.gz (2.0 MB)
|████████████████████████████████| 2.0 MB 4.5 MB/s
ERROR: Command errored out with exit status 1:
command: /usr/local/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-a0ddbdtm/MACS2/setup.py'"'"'; __file__='"'"'/tmp/pip-install-a0ddbdtm/MACS2/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-install-a0ddbdtm/MACS2/pip-egg-info
cwd: /tmp/pip-install-a0ddbdtm/MACS2/
Complete output (5 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-a0ddbdtm/MACS2/setup.py", line 16, in <module>
from numpy import get_include as numpy_get_include
ModuleNotFoundError: No module named 'numpy'
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
Even if NumPy and MACS2 are both listed in a requirements.txt file, installation of MACS2 will still fail, because pip imports this setup.py between downloading and installing packages:
$ docker run -it --rm python:3 /bin/bash
root@ef1339bcaf4e:/# echo 'numpy==1.18.2' > requirements.txt
root@ef1339bcaf4e:/# echo 'MACS2==2.2.6' >> requirements.txt
root@ef1339bcaf4e:/# pip install -r requirements.txt
Collecting numpy==1.18.2
Downloading numpy-1.18.2-cp38-cp38-manylinux1_x86_64.whl (20.6 MB)
|████████████████████████████████| 20.6 MB 4.6 MB/s
Collecting MACS2==2.2.6
Downloading MACS2-2.2.6.tar.gz (2.0 MB)
|████████████████████████████████| 2.0 MB 33.1 MB/s
ERROR: Command errored out with exit status 1:
command: /usr/local/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-88yrb2td/MACS2/setup.py'"'"'; __file__='"'"'/tmp/pip-install-88yrb2td/MACS2/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-install-88yrb2td/MACS2/pip-egg-info
cwd: /tmp/pip-install-88yrb2td/MACS2/
Complete output (5 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-88yrb2td/MACS2/setup.py", line 16, in <module>
from numpy import get_include as numpy_get_include
ModuleNotFoundError: No module named 'numpy'
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
Expected behavior
NumPy would be installed as a dependency of MACS2, instead of setup.py failing due to the lack of this package.
System (please complete the following information):
OS: python:3 Docker image
Python version: 3.8.2 as of writing this, but also encountered this under 3.6.9 on Ubuntu 18.04
Numpy version: None - that's the problem
MACS Version 2.2.6
The text was updated successfully, but these errors were encountered:
Describe the bug
The install instructions at https://github.com/taoliu/MACS/blob/5e742732e32f6e5648b2bd5466d50e32f66f8ad0/INSTALL.md#install-through-pypi say that "PyPI will
install Numpy automatically if it is absent."
This doesn't work, because
setup.py
imports NumPy directly: https://github.com/taoliu/MACS/blob/5e742732e32f6e5648b2bd5466d50e32f66f8ad0/setup.py#L16This is easy to work around, and most people probably won't ever encounter this -- I assume most installations of MACS2 are in an existing Python environment that already includes NumPy. It's easy to hit this when building a Docker image though, with the common practice of creating a
requirements.txt
file,COPY
ing that to the container, then runningpip install -r requirements.txt
.In any case, this should probably either be fixed or the installation instructions should be modified. (It's also more accurate to say "
pip
will install NumPy automatically ..." instead of "PyPI ..." if modifying those instructions.)To Reproduce
Even if NumPy and MACS2 are both listed in a
requirements.txt
file, installation of MACS2 will still fail, becausepip
imports thissetup.py
between downloading and installing packages:Expected behavior
NumPy would be installed as a dependency of MACS2, instead of
setup.py
failing due to the lack of this package.System (please complete the following information):
python:3
Docker imageThe text was updated successfully, but these errors were encountered: