我的PyCharm控制台建议ImportError: No module named sha3
因此,我决定安装此模块。
但是,使用pip install sha3
命令时出现此错误,整个过程和说明如下。
Collecting sha3
Using cached https://files.pythonhosted.org/packages/b3/b4/d23c8e8843226dcf54c6c533a6717d34d50358f74496cfa77e6e8c7e146a/sha3-0.2.1.tar.gz
Building wheels for collected packages: sha3
Running setup.py bdist_wheel for sha3 ... error
Complete output from command /Applications/anaconda3/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/fc/_2t60h750rl4svnh50tp3l7h0000gn/T/pip-install-mlrjkbkr/sha3/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/fc/_2t60h750rl4svnh50tp3l7h0000gn/T/pip-wheel-rsy0_asx --python-tag cp37:
running bdist_wheel
running build
running build_py
creating build
creating build/lib.macosx-10.7-x86_64-3.7
creating build/lib.macosx-10.7-x86_64-3.7/sha3
copying sha3/__init__.py -> build/lib.macosx-10.7-x86_64-3.7/sha3
running build_ext
building '_sha3' extension
creating build/temp.macosx-10.7-x86_64-3.7
creating build/temp.macosx-10.7-x86_64-3.7/src
creating build/temp.macosx-10.7-x86_64-3.7/src/64
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Applications/anaconda3/include -arch x86_64 -I/Applications/anaconda3/include -arch x86_64 -Isrc/ -Isrc/64 -I/Applications/anaconda3/include/python3.7m -c sha3.c -o build/temp.macosx-10.7-x86_64-3.7/sha3.o
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
error: command 'gcc' failed with exit status 1
----------------------------------------
Failed building wheel for sha3
Running setup.py clean for sha3
Failed to build sha3
Installing collected packages: sha3
Running setup.py install for sha3 ... error
Complete output from command /Applications/anaconda3/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/fc/_2t60h750rl4svnh50tp3l7h0000gn/T/pip-install-mlrjkbkr/sha3/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/fc/_2t60h750rl4svnh50tp3l7h0000gn/T/pip-record-15ac0elc/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.7
creating build/lib.macosx-10.7-x86_64-3.7/sha3
copying sha3/__init__.py -> build/lib.macosx-10.7-x86_64-3.7/sha3
running build_ext
building '_sha3' extension
creating build/temp.macosx-10.7-x86_64-3.7
creating build/temp.macosx-10.7-x86_64-3.7/src
creating build/temp.macosx-10.7-x86_64-3.7/src/64
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Applications/anaconda3/include -arch x86_64 -I/Applications/anaconda3/include -arch x86_64 -Isrc/ -Isrc/64 -I/Applications/anaconda3/include/python3.7m -c sha3.c -o build/temp.macosx-10.7-x86_64-3.7/sha3.o
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
error: command 'gcc' failed with exit status 1
----------------------------------------
Command "/Applications/anaconda3/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/fc/_2t60h750rl4svnh50tp3l7h0000gn/T/pip-install-mlrjkbkr/sha3/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/fc/_2t60h750rl4svnh50tp3l7h0000gn/T/pip-record-15ac0elc/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/fc/_2t60h750rl4svnh50tp3l7h0000gn/T/pip-install-mlrjkbkr/sha3/
我不知道该如何解决。