frictionlessdata / frictionless-py

Data management framework for Python that provides functionality to describe, extract, validate, and transform tabular data
https://framework.frictionlessdata.io
MIT License
701 stars 147 forks source link

Build error related to `cchardet` (add readme note for Mac) #273

Closed todrobbins closed 5 years ago

todrobbins commented 6 years ago

I'm trying to install goodtables with pip install goodtables and get this error near the end of the build process:

Failed building wheel for cchardet
  Running setup.py clean for cchardet
Failed to build cchardet
Installing collected packages: jsonschema, jsonpointer, unicodecsv, cchardet, sqlalchemy, linear-tsv, click, xlrd, tabulator, rfc3986, tableschema, datapackage, simpleeval, docutils, statistics, click-default-group, goodtables
  Running setup.py install for cchardet ... error
    Complete output from command /usr/local/opt/python/bin/python3.7 -u -c "import setuptools, tokenize;__file__='/private/var/folders/8h/kkv31w1x2sj2fhzr2bhtrz0h0000gn/T/pip-install-3mcsqjn0/cchardet/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /private/var/folders/8h/kkv31w1x2sj2fhzr2bhtrz0h0000gn/T/pip-record-mxi6e59e/install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_py
    creating build
    creating build/lib.macosx-10.13-x86_64-3.7
    creating build/lib.macosx-10.13-x86_64-3.7/cchardet
    copying src/cchardet/version.py -> build/lib.macosx-10.13-x86_64-3.7/cchardet
    copying src/cchardet/__init__.py -> build/lib.macosx-10.13-x86_64-3.7/cchardet
    running build_ext
    building 'cchardet._cchardet' extension
    creating build/temp.macosx-10.13-x86_64-3.7
    creating build/temp.macosx-10.13-x86_64-3.7/src
    creating build/temp.macosx-10.13-x86_64-3.7/src/cchardet
    creating build/temp.macosx-10.13-x86_64-3.7/src/ext
    creating build/temp.macosx-10.13-x86_64-3.7/src/ext/libcharsetdetect
    creating build/temp.macosx-10.13-x86_64-3.7/src/ext/libcharsetdetect/mozilla
    creating build/temp.macosx-10.13-x86_64-3.7/src/ext/libcharsetdetect/mozilla/extensions
    creating build/temp.macosx-10.13-x86_64-3.7/src/ext/libcharsetdetect/mozilla/extensions/universalchardet
    creating build/temp.macosx-10.13-x86_64-3.7/src/ext/libcharsetdetect/mozilla/extensions/universalchardet/src
    creating build/temp.macosx-10.13-x86_64-3.7/src/ext/libcharsetdetect/mozilla/extensions/universalchardet/src/base
    clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Isrc/ext/libcharsetdetect/mozilla/extensions/universalchardet/src/base/ -Isrc/ext/libcharsetdetect/nspr-emu/ -Isrc/ext/libcharsetdetect/ -I/usr/local/include -I/usr/local/opt/openssl/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/include/python3.7m -c src/cchardet/_cchardet.cpp -o build/temp.macosx-10.13-x86_64-3.7/src/cchardet/_cchardet.o
    src/cchardet/_cchardet.cpp:2351:65: error: too many arguments to function call, expected 3, have 4
        return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs, NULL);
               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                     ^~~~
    /usr/local/Cellar/llvm/6.0.1/lib/clang/6.0.1/include/stddef.h:100:18: note: expanded from macro 'NULL'
    #    define NULL __null
                     ^~~~~~
    1 error generated.
    error: command 'clang' failed with exit status 1

    ----------------------------------------
Command "/usr/local/opt/python/bin/python3.7 -u -c "import setuptools, tokenize;__file__='/private/var/folders/8h/kkv31w1x2sj2fhzr2bhtrz0h0000gn/T/pip-install-3mcsqjn0/cchardet/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /private/var/folders/8h/kkv31w1x2sj2fhzr2bhtrz0h0000gn/T/pip-record-mxi6e59e/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/8h/kkv31w1x2sj2fhzr2bhtrz0h0000gn/T/pip-install-3mcsqjn0/cchardet/

Any clues here? I can provide the entire log if needed.

Cheers!

todrobbins commented 6 years ago

PS: Here's my pip version:

pip 18.0 from /usr/local/lib/python3.7/site-packages/pip (python 3.7)

roll commented 6 years ago

Hi @todrobbins Can it be related to https://github.com/facelessuser/Rummage/issues/133#issuecomment-398230940

roll commented 6 years ago

Also https://github.com/PyYoshi/cChardet/issues/37

We don't test with Python 3.7 on Travis yet

todrobbins commented 6 years ago

Apologies for just getting to your responses, crazy month. I'm not sure how I ended up with pip from Python 3.7 since I also have pip3... I'll troubleshoot my own setup again before troubling you all. Closing for now!

nathanxmeyer commented 5 years ago

I have MacOS 10.14, new mbp and was trying to get my python environment built, failed to load good tables with error as above. After much searching, including install Xcode I found this set of commands that fixed the problem:

https://github.com/google/jsonnet/issues/573#issuecomment-433201074

lukik commented 5 years ago

I have MacOS 10.14, new mbp and was trying to get my python environment built, failed to load good tables with error as above. After much searching, including install Xcode I found this set of commands that fixed the problem:

google/jsonnet#573 (comment)

Had the same issue. Python3.6 though. The solution of installing macOS_SDK_headers_for_macOS_10.14.pkg worked like a charm

roll commented 5 years ago

Thanks, it's really great I'll add it to the readme