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

Installation fails on any platform (failed to build charlockholmes) #25

Open
rudskoy opened this issue Jun 6, 2018 · 2 comments
Open

Comments

@rudskoy
Copy link

rudskoy commented Jun 6, 2018

It fails via easy_install, pip2 or pip3 on latest linux and macos on charlockholmes build attempt.
It repeats on each attempt on any platform.

Error from pip:

rudskoy@ツ:~ $ pip install linguist
Collecting linguist
Collecting charlockholmes (from linguist)
  Using cached https://files.pythonhosted.org/packages/85/f0/d2543be235dfe645e7ea4efe230fd296ac558c74ecc76770c03b8962e346/charlockholmes-0.0.3.tar.gz
Requirement already satisfied: PyYAML in /usr/local/lib/python3.6/site-packages (from linguist) (3.12)
Requirement already satisfied: pygments-github-lexers>=0.0.3 in /usr/local/lib/python3.6/site-packages (from linguist) (0.0.5)
Collecting scanner>=0.0.4 (from linguist)
Collecting mime>=0.0.3 (from linguist)
Requirement already satisfied: pygments>=2.0.2 in /usr/local/lib/python3.6/site-packages (from pygments-github-lexers>=0.0.3->linguist) (2.2.0)
Collecting future (from mime>=0.0.3->linguist)
Building wheels for collected packages: charlockholmes
  Running setup.py bdist_wheel for charlockholmes ... error
  Complete output from command /usr/local/opt/python/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/private/var/folders/7r/pwp1r9_n7gjbk4dbt9y3s1smz2vkr7/T/pip-install-bcj_dr8c/charlockholmes/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 /private/var/folders/7r/pwp1r9_n7gjbk4dbt9y3s1smz2vkr7/T/pip-wheel-io0tdlm_ --python-tag cp36:
  running bdist_wheel
  running build
  running build_ext
  building 'charlockholmes' extension
  creating build
  creating build/temp.macosx-10.12-x86_64-3.6
  creating build/temp.macosx-10.12-x86_64-3.6/src
  clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/usr/local/include -I/usr/local/include -I/usr/local/include -I/usr/local/opt/openssl/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/python/3.6.4_3/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c src/charlockholmes.c -o build/temp.macosx-10.12-x86_64-3.6/src/charlockholmes.o
  clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/usr/local/include -I/usr/local/include -I/usr/local/include -I/usr/local/opt/openssl/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/python/3.6.4_3/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c src/encoding_detector.c -o build/temp.macosx-10.12-x86_64-3.6/src/encoding_detector.o
  src/encoding_detector.c:2:10: fatal error: 'unicode/ucsdet.h' file not found
  #include "unicode/ucsdet.h"
           ^~~~~~~~~~~~~~~~~~
  1 error generated.
  error: command 'clang' failed with exit status 1
  
  ----------------------------------------
  Failed building wheel for charlockholmes
  Running setup.py clean for charlockholmes
Failed to build charlockholmes
Installing collected packages: charlockholmes, scanner, future, mime, linguist
  Running setup.py install for charlockholmes ... error
    Complete output from command /usr/local/opt/python/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/private/var/folders/7r/pwp1r9_n7gjbk4dbt9y3s1smz2vkr7/T/pip-install-bcj_dr8c/charlockholmes/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/7r/pwp1r9_n7gjbk4dbt9y3s1smz2vkr7/T/pip-record-vzwqamg9/install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_ext
    building 'charlockholmes' extension
    creating build
    creating build/temp.macosx-10.12-x86_64-3.6
    creating build/temp.macosx-10.12-x86_64-3.6/src
    clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/usr/local/include -I/usr/local/include -I/usr/local/include -I/usr/local/opt/openssl/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/python/3.6.4_3/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c src/charlockholmes.c -o build/temp.macosx-10.12-x86_64-3.6/src/charlockholmes.o
    clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/usr/local/include -I/usr/local/include -I/usr/local/include -I/usr/local/opt/openssl/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/python/3.6.4_3/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c src/encoding_detector.c -o build/temp.macosx-10.12-x86_64-3.6/src/encoding_detector.o
    src/encoding_detector.c:2:10: fatal error: 'unicode/ucsdet.h' file not found
    #include "unicode/ucsdet.h"
             ^~~~~~~~~~~~~~~~~~
    1 error generated.
    error: command 'clang' failed with exit status 1
    
    ----------------------------------------
Command "/usr/local/opt/python/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/private/var/folders/7r/pwp1r9_n7gjbk4dbt9y3s1smz2vkr7/T/pip-install-bcj_dr8c/charlockholmes/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/7r/pwp1r9_n7gjbk4dbt9y3s1smz2vkr7/T/pip-record-vzwqamg9/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/7r/pwp1r9_n7gjbk4dbt9y3s1smz2vkr7/T/pip-install-bcj_dr8c/charlockholmes/

Error from easy_install:

rudskoy@ツ:~ $ easy_install linguist
Searching for linguist
Reading https://pypi.org/simple/linguist/
Downloading https://files.pythonhosted.org/packages/51/f1/2ec9861e9fca2b64767ffbaa915d6491ba82b9e8611932fad3cee00b5530/linguist-0.1.1-py2.7.egg#sha256=bafafc0119266403a392b836e0ca29febcff401440946d361053a40d42852bb5
Best match: linguist 0.1.1
Processing linguist-0.1.1-py2.7.egg
creating /usr/local/lib/python2.7/site-packages/linguist-0.1.1-py2.7.egg
Extracting linguist-0.1.1-py2.7.egg to /usr/local/lib/python2.7/site-packages
Adding linguist 0.1.1 to easy-install.pth file
Installing pylinguist script to /usr/local/bin

Installed /usr/local/lib/python2.7/site-packages/linguist-0.1.1-py2.7.egg
Reading https://github.com/liluo/pygments-main/tarball/master
Processing dependencies for linguist
Searching for charlockholmes
Reading https://pypi.org/simple/charlockholmes/
Downloading https://files.pythonhosted.org/packages/85/f0/d2543be235dfe645e7ea4efe230fd296ac558c74ecc76770c03b8962e346/charlockholmes-0.0.3.tar.gz#sha256=3c2cb1d654439f01010ea6086ad58435d2247f4c0c7af54abe9ed0d7b46968fa
Best match: charlockholmes 0.0.3
Processing charlockholmes-0.0.3.tar.gz
Writing /var/folders/7r/pwp1r9_n7gjbk4dbt9y3s1smz2vkr7/T/easy_install-gh4GVr/charlockholmes-0.0.3/setup.cfg
Running charlockholmes-0.0.3/setup.py -q bdist_egg --dist-dir /var/folders/7r/pwp1r9_n7gjbk4dbt9y3s1smz2vkr7/T/easy_install-gh4GVr/charlockholmes-0.0.3/egg-dist-tmp-1SbqzP
src/encoding_detector.c:2:10: fatal error: 'unicode/ucsdet.h' file not found
#include "unicode/ucsdet.h"
         ^~~~~~~~~~~~~~~~~~
1 error generated.
error: Setup script exited with error: command 'clang' failed with exit status 1
@nick-dai
Copy link

nick-dai commented Aug 6, 2018

To avoid problems caused by lack of unicode/ucsdet.h and magic.h, you can install the following dependencies:

sudo apt install libmagic-dev libicu-dev -y

@vegerot
Copy link

vegerot commented Feb 10, 2020

On macOS run

brew install libmagic icu4c
export LDFLAGS="-L/usr/local/opt/icu4c/lib"
export CPPFLAGS="-I/usr/local/opt/icu4c/include"
export PATH="/usr/local/opt/icu4c/sbin:$PATH"
export PATH="/usr/local/opt/icu4c/bin:$PATH"
export PKG_CONFIG_PATH="/usr/local/opt/icu4c/lib/pkgconfig"
pip3 install linguist

works.
Most of this is unnecessary, but I threw everything at the wall and it works

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

3 participants