Failed building wheel for cchardet

See original GitHub issue

Describe the bug Attempting to install PUDL locally on a mac (pip install -e .) failed because cchardet couldn’t be built from wheels. I’m not sure which library has cchardet as a dependency, but it’s something in setup.py. This issue can be resolved by including cchardet in environment.yml and adding conda-forge as a channel.

Here’s a section of the output when attempting to install with pip.

Installing collected packages: cchardet
  Running setup.py install for cchardet ... error
    Complete output from command /Users/greg/miniconda3/envs/psci/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/xz/k7lpq96j3133dm4_p28fxyzm0000gp/T/pip-install-3za3d5js/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/xz/k7lpq96j3133dm4_p28fxyzm0000gp/T/pip-record-1cv1yb98/install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_py
    creating build
    creating build/lib.macosx-10.7-x86_64-3.6
    creating build/lib.macosx-10.7-x86_64-3.6/cchardet
    copying src/cchardet/version.py -> build/lib.macosx-10.7-x86_64-3.6/cchardet
    copying src/cchardet/__init__.py -> build/lib.macosx-10.7-x86_64-3.6/cchardet
    running build_ext
    building 'cchardet._cchardet' extension
    creating build/temp.macosx-10.7-x86_64-3.6
    creating build/temp.macosx-10.7-x86_64-3.6/src
    creating build/temp.macosx-10.7-x86_64-3.6/src/cchardet
    creating build/temp.macosx-10.7-x86_64-3.6/src/ext
    creating build/temp.macosx-10.7-x86_64-3.6/src/ext/uchardet
    creating build/temp.macosx-10.7-x86_64-3.6/src/ext/uchardet/src
    creating build/temp.macosx-10.7-x86_64-3.6/src/ext/uchardet/src/LangModels
    gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -I/Users/greg/miniconda3/envs/psci/include -arch x86_64 -I/Users/greg/miniconda3/envs/psci/include -arch x86_64 -Isrc/ext/uchardet/src -I/Users/greg/miniconda3/envs/psci/include/python3.6m -c src/cchardet/_cchardet.cpp -o build/temp.macosx-10.7-x86_64-3.6/src/cchardet/_cchardet.o
    warning: include path for stdlibc++ headers not found; pass '-std=libc++' on the command line to use the libc++ standard library instead [-Wstdlibcxx-not-found]
    1 warning generated.
    gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -I/Users/greg/miniconda3/envs/psci/include -arch x86_64 -I/Users/greg/miniconda3/envs/psci/include -arch x86_64 -Isrc/ext/uchardet/src -I/Users/greg/miniconda3/envs/psci/include/python3.6m -c src/ext/uchardet/src/CharDistribution.cpp -o build/temp.macosx-10.7-x86_64-3.6/src/ext/uchardet/src/CharDistribution.o
    warning: include path for stdlibc++ headers not found; pass '-std=libc++' on the command line to use the libc++ standard library instead [-Wstdlibcxx-not-found]
    1 warning generated.
    gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -I/Users/greg/miniconda3/envs/psci/include -arch x86_64 -I/Users/greg/miniconda3/envs/psci/include -arch x86_64 -Isrc/ext/uchardet/src -I/Users/greg/miniconda3/envs/psci/include/python3.6m -c src/ext/uchardet/src/JpCntx.cpp -o build/temp.macosx-10.7-x86_64-3.6/src/ext/uchardet/src/JpCntx.o
    warning: include path for stdlibc++ headers not found; pass '-std=libc++' on the command line to use the libc++ standard library instead [-Wstdlibcxx-not-found]
    .
    .
    .
    .
    1 warning generated.
    gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -I/Users/greg/miniconda3/envs/psci/include -arch x86_64 -I/Users/greg/miniconda3/envs/psci/include -arch x86_64 -Isrc/ext/uchardet/src -I/Users/greg/miniconda3/envs/psci/include/python3.6m -c src/ext/uchardet/src/nsUniversalDetector.cpp -o build/temp.macosx-10.7-x86_64-3.6/src/ext/uchardet/src/nsUniversalDetector.o
    warning: include path for stdlibc++ headers not found; pass '-std=libc++' on the command line to use the libc++ standard library instead [-Wstdlibcxx-not-found]
    1 warning generated.
    gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -I/Users/greg/miniconda3/envs/psci/include -arch x86_64 -I/Users/greg/miniconda3/envs/psci/include -arch x86_64 -Isrc/ext/uchardet/src -I/Users/greg/miniconda3/envs/psci/include/python3.6m -c src/ext/uchardet/src/uchardet.cpp -o build/temp.macosx-10.7-x86_64-3.6/src/ext/uchardet/src/uchardet.o
    warning: include path for stdlibc++ headers not found; pass '-std=libc++' on the command line to use the libc++ standard library instead [-Wstdlibcxx-not-found]
    1 warning generated.
    g++ -bundle -undefined dynamic_lookup -L/Users/greg/miniconda3/envs/psci/lib -arch x86_64 -L/Users/greg/miniconda3/envs/psci/lib -arch x86_64 -arch x86_64 build/temp.macosx-10.7-x86_64-3.6/src/cchardet/_cchardet.o build/temp.macosx-10.7-x86_64-3.6/src/ext/uchardet/src/CharDistribution.o build/temp.macosx-10.7-x86_64-3.6/src/ext/uchardet/src/JpCntx.o build/temp.macosx-10.7-x86_64-3.6/src/ext/uchardet/src/LangModels/LangArabicModel.o build/temp.macosx-10.7-x86_64-3.6/src/ext/uchardet/src/LangModels/LangBulgarianModel.o build/temp.macosx-10.7-x86_64-3.6/src/ext/uchardet/src/LangModels/LangCroatianModel.o build/temp.macosx-10.7-x86_64-3.6/src/ext/uchardet/src/LangModels/LangCzechModel.o build/temp.macosx-10.7-x86_64-3.6/src/ext/uchardet/src/LangModels/LangEsperantoModel.o build/temp.macosx-10.7-x86_64-3.6/src/ext/uchardet/src/LangModels/LangEstonianModel.o build/temp.macosx-10.7-x86_64-3.6/src/ext/uchardet/src/LangModels/LangFinnishModel.o build/temp.macosx-10.7-x86_64-3.6/src/ext/uchardet/src/LangModels/LangFrenchModel.o build/temp.macosx-10.7-x86_64-3.6/src/ext/uchardet/src/LangModels/LangDanishModel.o build/temp.macosx-10.7-x86_64-3.6/src/ext/uchardet/src/LangModels/LangGermanModel.o build/temp.macosx-10.7-x86_64-3.6/src/ext/uchardet/src/LangModels/LangGreekModel.o build/temp.macosx-10.7-x86_64-3.6/src/ext/uchardet/src/LangModels/LangHungarianModel.o build/temp.macosx-10.7-x86_64-3.6/src/ext/uchardet/src/LangModels/LangHebrewModel.o build/temp.macosx-10.7-x86_64-3.6/src/ext/uchardet/src/LangModels/LangIrishModel.o build/temp.macosx-10.7-x86_64-3.6/src/ext/uchardet/src/LangModels/LangItalianModel.o build/temp.macosx-10.7-x86_64-3.6/src/ext/uchardet/src/LangModels/LangLithuanianModel.o build/temp.macosx-10.7-x86_64-3.6/src/ext/uchardet/src/LangModels/LangLatvianModel.o build/temp.macosx-10.7-x86_64-3.6/src/ext/uchardet/src/LangModels/LangMalteseModel.o build/temp.macosx-10.7-x86_64-3.6/src/ext/uchardet/src/LangModels/LangPolishModel.o build/temp.macosx-10.7-x86_64-3.6/src/ext/uchardet/src/LangModels/LangPortugueseModel.o build/temp.macosx-10.7-x86_64-3.6/src/ext/uchardet/src/LangModels/LangRomanianModel.o build/temp.macosx-10.7-x86_64-3.6/src/ext/uchardet/src/LangModels/LangRussianModel.o build/temp.macosx-10.7-x86_64-3.6/src/ext/uchardet/src/LangModels/LangSlovakModel.o build/temp.macosx-10.7-x86_64-3.6/src/ext/uchardet/src/LangModels/LangSloveneModel.o build/temp.macosx-10.7-x86_64-3.6/src/ext/uchardet/src/LangModels/LangSwedishModel.o build/temp.macosx-10.7-x86_64-3.6/src/ext/uchardet/src/LangModels/LangSpanishModel.o build/temp.macosx-10.7-x86_64-3.6/src/ext/uchardet/src/LangModels/LangThaiModel.o build/temp.macosx-10.7-x86_64-3.6/src/ext/uchardet/src/LangModels/LangTurkishModel.o build/temp.macosx-10.7-x86_64-3.6/src/ext/uchardet/src/LangModels/LangVietnameseModel.o build/temp.macosx-10.7-x86_64-3.6/src/ext/uchardet/src/nsHebrewProber.o build/temp.macosx-10.7-x86_64-3.6/src/ext/uchardet/src/nsCharSetProber.o build/temp.macosx-10.7-x86_64-3.6/src/ext/uchardet/src/nsBig5Prober.o build/temp.macosx-10.7-x86_64-3.6/src/ext/uchardet/src/nsEUCJPProber.o build/temp.macosx-10.7-x86_64-3.6/src/ext/uchardet/src/nsEUCKRProber.o build/temp.macosx-10.7-x86_64-3.6/src/ext/uchardet/src/nsEUCTWProber.o build/temp.macosx-10.7-x86_64-3.6/src/ext/uchardet/src/nsEscCharsetProber.o build/temp.macosx-10.7-x86_64-3.6/src/ext/uchardet/src/nsEscSM.o build/temp.macosx-10.7-x86_64-3.6/src/ext/uchardet/src/nsGB2312Prober.o build/temp.macosx-10.7-x86_64-3.6/src/ext/uchardet/src/nsMBCSGroupProber.o build/temp.macosx-10.7-x86_64-3.6/src/ext/uchardet/src/nsMBCSSM.o build/temp.macosx-10.7-x86_64-3.6/src/ext/uchardet/src/nsSBCSGroupProber.o build/temp.macosx-10.7-x86_64-3.6/src/ext/uchardet/src/nsSBCharSetProber.o build/temp.macosx-10.7-x86_64-3.6/src/ext/uchardet/src/nsSJISProber.o build/temp.macosx-10.7-x86_64-3.6/src/ext/uchardet/src/nsUTF8Prober.o build/temp.macosx-10.7-x86_64-3.6/src/ext/uchardet/src/nsLatin1Prober.o build/temp.macosx-10.7-x86_64-3.6/src/ext/uchardet/src/nsUniversalDetector.o build/temp.macosx-10.7-x86_64-3.6/src/ext/uchardet/src/uchardet.o -o build/lib.macosx-10.7-x86_64-3.6/cchardet/_cchardet.cpython-36m-darwin.so
    clang: warning: libstdc++ is deprecated; move to libc++ with a minimum deployment target of OS X 10.9 [-Wdeprecated]
    ld: library not found for -lstdc++
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    error: command 'g++' failed with exit status 1

To Reproduce Try installing cchardet with pip. This could be an issue with needing to accept the xcode license after a new OS install but I don’t have the full xcode installed to save space.

Expected behavior A clear and concise description of what you expected to happen, or what you expected the data to look like.

Desktop (please complete the following information):

  • OS: Mac OS X Mojave
  • Python version 3.6/3.7

Additional context Add any other context about the problem here.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:9 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
gschivleycommented, Apr 2, 2019

@karldw Just tested, and yes it did. Moving goodtables from pip to conda-forge seems to have done the trick. Was able to create the environment and pip install pudl from setup.py.

Unfortunately I’m now dealing with a weird (possibly Mojave-update related) bug where I can’t remove conda environments.

1reaction
karldwcommented, Mar 27, 2019

FYI, adding conda-forge is part of PR #259

Read more comments on GitHub >

github_iconTop Results From Across the Web

Failed building wheel for cchardet when installing datadotworld
I got the error because I have upgraded to python 3.9 and the code and packages were not working.
Read more >
TWINT missingimport related to cchardet, cannot build wheel
note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for cchardet
Read more >
cchardet - PyPI
cChardet is high speed universal character encoding detector. - binding to uchardet. PyPI version Build for Linux Build for macOS Build for Windows ......
Read more >
failed building wheel for pandas - You.com | The AI Search ...
Your error message here is due to the wheel package being missing, which contains the logic required to build the wheels in setup.py...
Read more >
cchardet - Python Package Health Analysis - Snyk
cChardet is high speed universal character encoding detector. - binding to uchardet. PyPI version · Build for Linux · Build for macOS ·...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found