简体   繁体   中英

can't install "TWINT" on PYcharm-Conda, MacOS Catalina

Sorry if the question looks noobish, I'm really new to programming. I'm trying to install Twint and no matter what I do, I still can't. any idea how should I solve the problems?

 Building wheels for collected packages: cchardet   Building wheel for cchardet (setup.py) ... error   ERROR: Command errored out with exit status 1:    command: /Users/hrf/.conda/envs/untitled1/bin/python
-u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/c3/6hjdktd16z51lwy62051hkqr0000gn/T/pip-install-oittkttr/cchardet/setup.py'"'"';
__file__='"'"'/private/var/folders/c3/6hjdktd16z51lwy62051hkqr0000gn/T/pip-install-oittkttr/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 /private/var/folders/c3/6hjdktd16z51lwy62051hkqr0000gn/T/pip-wheel-omcuax3g
       cwd: /private/var/folders/c3/6hjdktd16z51lwy62051hkqr0000gn/T/pip-install-oittkttr/cchardet/ Complete output (28 lines):   running bdist_wheel   running build   running build_py   creating build   creating build/lib.macosx-10.9-x86_64-3.7   creating build/lib.macosx-10.9-x86_64-3.7/cchardet   copying src/cchardet/version.py -> build/lib.macosx-10.9-x86_64-3.7/cchardet   copying src/cchardet/__init__.py -> build/lib.macosx-10.9-x86_64-3.7/cchardet   running build_ext   building 'cchardet._cchardet' extension   creating build/temp.macosx-10.9-x86_64-3.7   creating build/temp.macosx-10.9-x86_64-3.7/src   creating build/temp.macosx-10.9-x86_64-3.7/src/cchardet   creating build/temp.macosx-10.9-x86_64-3.7/src/ext   creating build/temp.macosx-10.9-x86_64-3.7/src/ext/uchardet   creating build/temp.macosx-10.9-x86_64-3.7/src/ext/uchardet/src   creating build/temp.macosx-10.9-x86_64-3.7/src/ext/uchardet/src/LangModels   gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g
-fwrapv -O3 -Wall -I/Users/hrf/.conda/envs/untitled1/include -arch x86_64 -I/Users/hrf/.conda/envs/untitled1/include -arch x86_64 -Isrc/ext/uchardet/src
-I/Users/hrf/.conda/envs/untitled1/include/python3.7m -c src/cchardet/_cchardet.cpp -o build/temp.macosx-10.9-x86_64-3.7/src/cchardet/_cchardet.o   In file included from src/cchardet/_cchardet.cpp:4:   In file included from /Users/hrf/.conda/envs/untitled1/include/python3.7m/Python.h:119: In file included from /Users/hrf/.conda/envs/untitled1/include/python3.7m/traceback.h:8: In file included from /Users/hrf/.conda/envs/untitled1/include/python3.7m/pystate.h:11: In file included from /Users/hrf/.conda/envs/untitled1/include/python3.7m/pythread.h:114: /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/pthread.h:64:10: fatal error: 'sys/_pthread/_pthread_condattr_t.h' file not found  
#include <sys/_pthread/_pthread_condattr_t.h>
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   1 error generated.   error: command 'gcc' failed with exit status 1  
----------------------------------------   ERROR: Failed building wheel for cchardet   Running setup.py clean for cchardet Failed to build cchardet Installing collected packages: cchardet, twint
    Running setup.py install for cchardet ... error
    ERROR: Command errored out with exit status 1:
     command: /Users/hrf/.conda/envs/untitled1/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/c3/6hjdktd16z51lwy62051hkqr0000gn/T/pip-install-oittkttr/cchardet/setup.py'"'"';
__file__='"'"'/private/var/folders/c3/6hjdktd16z51lwy62051hkqr0000gn/T/pip-install-oittkttr/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/c3/6hjdktd16z51lwy62051hkqr0000gn/T/pip-record-2lrq6c5g/install-record.txt
--single-version-externally-managed --compile --install-headers /Users/hrf/.conda/envs/untitled1/include/python3.7m/cchardet
         cwd: /private/var/folders/c3/6hjdktd16z51lwy62051hkqr0000gn/T/pip-install-oittkttr/cchardet/
    Complete output (28 lines):
    running install
    running build
    running build_py
    creating build
    creating build/lib.macosx-10.9-x86_64-3.7
    creating build/lib.macosx-10.9-x86_64-3.7/cchardet
    copying src/cchardet/version.py -> build/lib.macosx-10.9-x86_64-3.7/cchardet
    copying src/cchardet/__init__.py -> build/lib.macosx-10.9-x86_64-3.7/cchardet
    running build_ext
    building 'cchardet._cchardet' extension
    creating build/temp.macosx-10.9-x86_64-3.7
    creating build/temp.macosx-10.9-x86_64-3.7/src
    creating build/temp.macosx-10.9-x86_64-3.7/src/cchardet
    creating build/temp.macosx-10.9-x86_64-3.7/src/ext
    creating build/temp.macosx-10.9-x86_64-3.7/src/ext/uchardet
    creating build/temp.macosx-10.9-x86_64-3.7/src/ext/uchardet/src
    creating build/temp.macosx-10.9-x86_64-3.7/src/ext/uchardet/src/LangModels
    gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -I/Users/hrf/.conda/envs/untitled1/include -arch x86_64 -I/Users/hrf/.conda/envs/untitled1/include -arch x86_64 -Isrc/ext/uchardet/src
-I/Users/hrf/.conda/envs/untitled1/include/python3.7m -c src/cchardet/_cchardet.cpp -o build/temp.macosx-10.9-x86_64-3.7/src/cchardet/_cchardet.o
    In file included from src/cchardet/_cchardet.cpp:4:
    In file included from /Users/hrf/.conda/envs/untitled1/include/python3.7m/Python.h:119:
    In file included from /Users/hrf/.conda/envs/untitled1/include/python3.7m/traceback.h:8:
    In file included from /Users/hrf/.conda/envs/untitled1/include/python3.7m/pystate.h:11:
    In file included from /Users/hrf/.conda/envs/untitled1/include/python3.7m/pythread.h:114:
    /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/pthread.h:64:10: fatal error: 'sys/_pthread/_pthread_condattr_t.h' file not found
    #include <sys/_pthread/_pthread_condattr_t.h>
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    1 error generated.
    error: command 'gcc' failed with exit status 1
    ---------------------------------------- ERROR: Command errored out with exit status 1: /Users/hrf/.conda/envs/untitled1/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/c3/6hjdktd16z51lwy62051hkqr0000gn/T/pip-install-oittkttr/cchardet/setup.py'"'"';
__file__='"'"'/private/var/folders/c3/6hjdktd16z51lwy62051hkqr0000gn/T/pip-install-oittkttr/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/c3/6hjdktd16z51lwy62051hkqr0000gn/T/pip-record-2lrq6c5g/install-record.txt
--single-version-externally-managed --compile --install-headers /Users/hrf/.conda/envs/untitled1/include/python3.7m/cchardet Check the logs for full command output.

The error appears when trying to install cchardet , which, according to the Pypi page, does not support anaconda . There seems to be a package in the conda-forge channel nonetheless. I would therefore suggest to try to install cchardet using

conda install -c conda-forge cchardet

and then try

pip install twint

again

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM