kennethreitz / maya

Datetimes for Humans™
MIT License
3.41k stars 196 forks source link

pip3 install maya doesn't install out of the box in python slim docker container. #174

Closed TZubiri closed 5 years ago

TZubiri commented 5 years ago

Building the following dockerfile:

FROM python:3.6-slim-stretch
RUN pip3 install maya

results in the following error:


Building wheel for regex (setup.py): finished with status 'error'**
  ERROR: Complete output from command /usr/local/bin/python -u -c 'import setuptools, tokenize;__file__='"'"'/tmp/pip-install-2bfp2pmb/regex/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-w4oflj3h --python-tag cp36:

  gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/usr/local/include/python3.6m -c regex_3/_regex.c -o build/temp.linux-x86_64-3.6/regex_3/_regex.o
  unable to execute 'gcc': No such file or directory
  error: command 'gcc' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for regex

installing gcc seems to solve this error. I'm looking forward to seeing how the install process could be improved to eliminate this error, and at what point in the dependency tree (maya? regex? pip? python container? dockerfile? ) an optimal solution could be implemented.

Thank you.

TZubiri commented 5 years ago

Similar issue reported last year:

https://github.com/kennethreitz/maya/issues/125

timofurrer commented 5 years ago

It's actually exactly the same issue as in #125 - and the exact same solution. Please install python3.6-dev.

TZubiri commented 5 years ago

As I mentioned, I have already solved this error. I am wondering how to fix this for other users. This is a packaging issue, given that the Kenneth Reitz community has experience with packaging due to Pipenv, I think it would be interesting to triage this.