无法在 PYcharm-Conda、MacOS Catalina 上安装 "TWINT"



对不起,如果这个问题看起来很菜鸟,我真的是编程新手。 我正在尝试安装Twint,无论我做什么,我仍然不能。知道我应该如何解决问题吗?

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('"'"'rn'"'"', '"'"'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('"'"'rn'"'"', '"'"'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('"'"'rn'"'"', '"'"'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.

尝试安装cchardet时出现错误,根据 Pypi 页面,它不支持anaconda。尽管如此,conda-forge渠道中似乎有一个包。因此,我建议尝试cchardet使用

conda install -c conda-forge cchardet

然后尝试

pip install twint

最新更新