Q: In my docker container, i use apline linux system which has been pre install gcc
apk info:
bash-4.4# apk info
....
gcc
But when I install multidict, failed by gcc error
bash-4.4# pip install multidict
Collecting multidict
Using cached https://files.pythonhosted.org/packages/84/96/5503ba866d8d216e49a6ce3bcb288df8a5fb3ac8a90b8fcff9ddcda32568/multidict-4.7.3.tar.gz
Building wheels for collected packages: multidict
Building wheel for multidict (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /usr/local/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-79jceuft/multidict/setup.py'"'"'; __file__='"'"'/tmp/pip-install-79jceuft/multidict/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-57k4lw21 --python-tag cp37
cwd: /tmp/pip-install-79jceuft/multidict/
....
/usr/local/include/python3.7m/Python.h:11:20: fatal error: limits.h: No such file or directory
#include <limits.h>
^
compilation terminated.
error: command 'gcc' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /usr/local/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-79jceuft/multidict/setup.py'"'"'; __file__='"'"'/tmp/pip-install-79jceuft/multidict/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-lomj_vmk/install-record.txt --single-version-externally-managed --compile Check the logs for full command output.
How can i fix this problem?
Simple fix was to add the below command in the dockerfile:
RUN apk --no-cache add gcc musl-dev
thanks to @Zosionlee for hint.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With