Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

simplify Dockerfile numpy-pandas dependecy #14

Open
jeremydouglass opened this issue Aug 5, 2018 · 1 comment
Open

simplify Dockerfile numpy-pandas dependecy #14

jeremydouglass opened this issue Aug 5, 2018 · 1 comment

Comments

@jeremydouglass
Copy link
Contributor

Currently pandas fails to build on a generic python3 container. Specifically, cchardet fails with a gcc error. In commit c28702d this is worked-around by building from an available pre-built numpy-pandas image instead:

FROM jjuanda/numpy-pandas

....however it is a personal image that lacks a public Dockerfile.

In the future we should rework the Dockerfile to add pandas / flask on top of an official distribution image.

If the Dockerfile is:

FROM python:3
RUN pip3 install pandas flask

Below are the error details:

Running setup.py bdist_wheel for cchardet: started

Running setup.py bdist_wheel for cchardet: finished with status 'error'

Complete output from command /usr/local/bin/python -u -c "import setuptools, tokenize;file='/tmp/pip-install-8x1_b8z6/cchardet/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-uno61gbs --python-tag cp37:
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.7
creating build/lib.linux-x86_64-3.7/cchardet
copying src/cchardet/version.py -> build/lib.linux-x86_64-3.7/cchardet
copying src/cchardet/init.py -> build/lib.linux-x86_64-3.7/cchardet
running build_ext
building 'cchardet._cchardet' extension
creating build/temp.linux-x86_64-3.7
creating build/temp.linux-x86_64-3.7/src
creating build/temp.linux-x86_64-3.7/src/cchardet
creating build/temp.linux-x86_64-3.7/src/ext
creating build/temp.linux-x86_64-3.7/src/ext/libcharsetdetect
creating build/temp.linux-x86_64-3.7/src/ext/libcharsetdetect/mozilla
creating build/temp.linux-x86_64-3.7/src/ext/libcharsetdetect/mozilla/extensions
creating build/temp.linux-x86_64-3.7/src/ext/libcharsetdetect/mozilla/extensions/universalchardet
creating build/temp.linux-x86_64-3.7/src/ext/libcharsetdetect/mozilla/extensions/universalchardet/src
creating build/temp.linux-x86_64-3.7/src/ext/libcharsetdetect/mozilla/extensions/universalchardet/src/base
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -Isrc/ext/libcharsetdetect/mozilla/extensions/universalchardet/src/base/ -Isrc/ext/libcharsetdetect/nspr-emu/ -Isrc/ext/libcharsetdetect/ -I/usr/local/include/python3.7m -c src/cchardet/_cchardet.cpp -o build/temp.linux-x86_64-3.7/src/cchardet/_cchardet.o
src/cchardet/_cchardet.cpp: In function ‘PyObject* __Pyx_PyCFunction_FastCall(PyObject*, PyObject**, Py_ssize_t)’:
src/cchardet/_cchardet.cpp:2351:69: error: too many arguments to function
return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs, NULL);
^
error: command 'gcc' failed with exit status 1

@jeremydouglass
Copy link
Contributor Author

jeremydouglass commented Aug 5, 2018

I was able to locally work around cchardet failing to build by running pip install cython first.

Cython is listed as an optional dependency for pandas. It is required by other dependencies of our project, like tabulator.

Examples of fixing related cchardet install problems by pre-installing cython:

Will test to see if adding that to requirements can also be used for a generic image build on DockerHub.

jeremydouglass added a commit that referenced this issue Aug 10, 2018
Pinned python version. addresses "Dockerfile numpy-pandas dependecy" #14
jeremydouglass added a commit that referenced this issue Aug 10, 2018
addresses "Dockerfile numpy-pandas dependecy" #14
jeremydouglass added a commit that referenced this issue Aug 11, 2018
closes #14 "Dockerfile numpy-pandas dependecy"
jeremydouglass added a commit that referenced this issue Aug 11, 2018
closes #14 "Dockerfile numpy-pandas dependecy"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant