1

I am running virtualenv with python 3.6 and am trying to load test a django app. I get the following error after all dependencies install successfully before it.

Installing collected packages: greenlet, gevent, locustio
  Running setup.py install for greenlet ... error
    Complete output from command /Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/private/var/folders/3t/_nx5hykn0hsfs5v1x_svhdym0000gn/T/pip-install-lrm7ibd5/greenlet/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/3t/_nx5hykn0hsfs5v1x_svhdym0000gn/T/pip-record-77exz0iu/install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_ext
    building 'greenlet' extension
    creating build
    creating build/temp.macosx-10.6-intel-3.6
    gcc -fno-strict-aliasing -Wsign-compare -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -arch i386 -arch x86_64 -g -I/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c greenlet.c -o build/temp.macosx-10.6-intel-3.6/greenlet.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 "/Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/private/var/folders/3t/_nx5hykn0hsfs5v1x_svhdym0000gn/T/pip-install-lrm7ibd5/greenlet/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/3t/_nx5hykn0hsfs5v1x_svhdym0000gn/T/pip-record-77exz0iu/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/3t/_nx5hykn0hsfs5v1x_svhdym0000gn/T/pip-install-lrm7ibd5/greenlet/
vencaslac
  • 2,727
  • 1
  • 18
  • 29
Ty C
  • 69
  • 9
  • https://stackoverflow.com/search?q=invalid+active+developer+path+%28%2FLibrary%2FDeveloper%2FCommandLineTools%29%2C+missing+xcrun+at%3A+%2FLibrary%2FDeveloper%2FCommandLineTools%2Fusr%2Fbin%2Fxcrun – phd Nov 13 '18 at 22:16

1 Answers1

2

run in terminal xcode-select --install this will install the xcode comand line tools (not xcode itself), you will be asked for a password and to agree to a license.

This happens because one (or more) of the packages include C extensions that need compilation, and to compile the xcode command line tools are needed.

A separate solution would be to install Anaconda python, miniconda if you don't need packages for scientific python, this python distribution includes a package manager (conda) that work much like pip but with the advantage of having precompiled packages

Dalvenjia
  • 1,953
  • 1
  • 12
  • 16