0

I am trying to run the following command

sudo pip install cryptography

But am getting the following error:

      2 errors generated.
      error: command 'clang' failed with exit status 1
      ----------------------------------------
  ERROR: Command errored out with exit status 1: /Applications/Xcode.app/Contents/Developer/usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/tmp/pip-install-qzwkn9nh/cffi/setup.py'"'"'; __file__='"'"'/private/tmp/pip-install-qzwkn9nh/cffi/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/tmp/pip-record-qqv4yi4n/install-record.txt --single-version-externally-managed --prefix /private/tmp/pip-build-env-vxrnkhjr/overlay --compile --install-headers /private/tmp/pip-build-env-vxrnkhjr/overlay/include/python3.8/cffi Check the logs for full command output.
  ----------------------------------------
ERROR: Command errored out with exit status 1: /Applications/Xcode.app/Contents/Developer/usr/bin/python3 /Library/Python/3.8/site-packages/pip install --ignore-installed --no-user --prefix /private/tmp/pip-build-env-vxrnkhjr/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- 'setuptools>=40.6.0' wheel 'cffi>=1.8,!=1.11.3; platform_python_implementation != '"'"'PyPy'"'"'' Check the logs for full command output.

I have tried updating everything including Python to Python 3.8, and pip to pip3. Nothing seems to be working and I am not sure why this vague error occurs. Has anyone come across this issue before?

Mac Version 11.1 Beta (20C5048k).

Xcode Version 12.2 (12B45b).

Papi
  • 255
  • 1
  • 2
  • 13
  • Do you have `clang` installed? Some packages have C program code and depend on having a C compiler installed on the local system. – John Gordon Nov 22 '20 at 18:50
  • Yes `Apple clang version 12.0.0 (clang-1200.0.32.27)` – Papi Nov 22 '20 at 18:54
  • The error messages says `Check the logs for full command output`. Have you looked in the pip installation logs to see what the error is? Or you can run pip in verbose mode with the `-v` flag, and I believe this will print the low-level errors without burying them in a log file. – John Gordon Nov 22 '20 at 18:58
  • You should almost never have to `sudo pip install` a package. It's a [dangerous thing to do](https://stackoverflow.com/questions/21055859/what-are-the-risks-of-running-sudo-pip) (and [here](https://stackoverflow.com/questions/15028648/is-it-acceptable-and-safe-to-run-pip-install-under-sudo)). – jarmod Nov 22 '20 at 19:02
  • I fixed it by installing conda – Papi Nov 22 '20 at 19:44

0 Answers0