0

My PyCharm console suggested that ImportError: No module named sha3 So I've decided to install this module.

However, this error emerged when using the command of pip install sha3, the whole process and descriptions are below.

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/

I have no idea how to fix this.

Jerry Yeats
  • 53
  • 1
  • 4
  • `xcrun` points to XCode. You could try running `xcode-select --install` to enable the developer tools and try again. – ferrix Feb 27 '19 at 06:52
  • Possible duplicate of [Git is not working after macOS Mojave Update (xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools)](https://stackoverflow.com/questions/52522565/git-is-not-working-after-macos-mojave-update-xcrun-error-invalid-active-devel) – phd Feb 27 '19 at 16:02
  • https://stackoverflow.com/search?q=%5Bmacos%5D+error%3A+invalid+active+developer+path+missing+xcrun – phd Feb 27 '19 at 16:02

0 Answers0