title: Can't Install psutil
body: <p>Can someone help me understand why I can't install psutil? I'm on MacOS. I'm a noob so bear with me, but any help would be appreciated. Could it be something to do with the default Python install vs v3 that I installed? I'm new to command line so confused about what is causing the error and how to fix it...</p>
  
  <p>This is the error message I get...</p>
  
  <pre><code>kasey@MacBook-Pro ~ % pip3 install psutil
  DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
  Defaulting to user installation because normal site-packages is not writeable
  Collecting psutil
    Downloading psutil-5.7.0.tar.gz (449 kB)
       |████████████████████████████████| 449 kB 150 kB/s
  Building wheels for collected packages: psutil
    Building wheel for psutil (setup.py) ... error
    ERROR: Command errored out with exit status 1:
     command: /System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/4h/g406694s1hb_rc1vwchcn08c0000gn/T/pip-install-HsBPVK/psutil/setup.py'"'"'; __file__='"'"'/private/var/folders/4h/g406694s1hb_rc1vwchcn08c0000gn/T/pip-install-HsBPVK/psutil/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/4h/g406694s1hb_rc1vwchcn08c0000gn/T/pip-wheel-dsejsf
         cwd: /private/var/folders/4h/g406694s1hb_rc1vwchcn08c0000gn/T/pip-install-HsBPVK/psutil/
    Complete output (43 lines):
    running bdist_wheel
    running build
    running build_py
    creating build
    creating build/lib.macosx-10.15-x86_64-2.7
    creating build/lib.macosx-10.15-x86_64-2.7/psutil
    copying psutil/_pswindows.py -&gt; build/lib.macosx-10.15-x86_64-2.7/psutil
    copying psutil/_common.py -&gt; build/lib.macosx-10.15-x86_64-2.7/psutil
    copying psutil/__init__.py -&gt; build/lib.macosx-10.15-x86_64-2.7/psutil
    copying psutil/_psosx.py -&gt; build/lib.macosx-10.15-x86_64-2.7/psutil
    copying psutil/_psbsd.py -&gt; build/lib.macosx-10.15-x86_64-2.7/psutil
    copying psutil/_psaix.py -&gt; build/lib.macosx-10.15-x86_64-2.7/psutil
    copying psutil/_pslinux.py -&gt; build/lib.macosx-10.15-x86_64-2.7/psutil
    copying psutil/_compat.py -&gt; build/lib.macosx-10.15-x86_64-2.7/psutil
    copying psutil/_psposix.py -&gt; build/lib.macosx-10.15-x86_64-2.7/psutil
    copying psutil/_pssunos.py -&gt; build/lib.macosx-10.15-x86_64-2.7/psutil
    creating build/lib.macosx-10.15-x86_64-2.7/psutil/tests
    copying psutil/tests/test_contracts.py -&gt; build/lib.macosx-10.15-x86_64-2.7/psutil/tests
    copying psutil/tests/test_connections.py -&gt; build/lib.macosx-10.15-x86_64-2.7/psutil/tests
    copying psutil/tests/runner.py -&gt; build/lib.macosx-10.15-x86_64-2.7/psutil/tests
    copying psutil/tests/test_unicode.py -&gt; build/lib.macosx-10.15-x86_64-2.7/psutil/tests
    copying psutil/tests/test_misc.py -&gt; build/lib.macosx-10.15-x86_64-2.7/psutil/tests
    copying psutil/tests/test_posix.py -&gt; build/lib.macosx-10.15-x86_64-2.7/psutil/tests
    copying psutil/tests/test_linux.py -&gt; build/lib.macosx-10.15-x86_64-2.7/psutil/tests
    copying psutil/tests/test_sunos.py -&gt; build/lib.macosx-10.15-x86_64-2.7/psutil/tests
    copying psutil/tests/__init__.py -&gt; build/lib.macosx-10.15-x86_64-2.7/psutil/tests
    copying psutil/tests/test_aix.py -&gt; build/lib.macosx-10.15-x86_64-2.7/psutil/tests
    copying psutil/tests/test_process.py -&gt; build/lib.macosx-10.15-x86_64-2.7/psutil/tests
    copying psutil/tests/test_bsd.py -&gt; build/lib.macosx-10.15-x86_64-2.7/psutil/tests
    copying psutil/tests/test_system.py -&gt; build/lib.macosx-10.15-x86_64-2.7/psutil/tests
    copying psutil/tests/test_osx.py -&gt; build/lib.macosx-10.15-x86_64-2.7/psutil/tests
    copying psutil/tests/test_memory_leaks.py -&gt; build/lib.macosx-10.15-x86_64-2.7/psutil/tests
    copying psutil/tests/test_windows.py -&gt; build/lib.macosx-10.15-x86_64-2.7/psutil/tests
    copying psutil/tests/__main__.py -&gt; build/lib.macosx-10.15-x86_64-2.7/psutil/tests
    running build_ext
    building 'psutil._psutil_osx' extension
    creating build/temp.macosx-10.15-x86_64-2.7
    creating build/temp.macosx-10.15-x86_64-2.7/psutil
    creating build/temp.macosx-10.15-x86_64-2.7/psutil/arch
    creating build/temp.macosx-10.15-x86_64-2.7/psutil/arch/osx
    cc -fno-strict-aliasing -fno-common -dynamic -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -iwithsysroot /usr/local/libressl/include -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch x86_64 -pipe -DPSUTIL_POSIX=1 -DPSUTIL_SIZEOF_PID_T=4 -DPSUTIL_VERSION=570 -DPSUTIL_OSX=1 -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c psutil/_psutil_common.c -o build/temp.macosx-10.15-x86_64-2.7/psutil/_psutil_common.o
    xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
    error: command 'cc' failed with exit status 1
    ----------------------------------------
    ERROR: Failed building wheel for psutil
    Running setup.py clean for psutil
  Failed to build psutil
  Installing collected packages: psutil
      Running setup.py install for psutil ... error
      ERROR: Command errored out with exit status 1:
       command: /System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/4h/g406694s1hb_rc1vwchcn08c0000gn/T/pip-install-HsBPVK/psutil/setup.py'"'"'; __file__='"'"'/private/var/folders/4h/g406694s1hb_rc1vwchcn08c0000gn/T/pip-install-HsBPVK/psutil/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/4h/g406694s1hb_rc1vwchcn08c0000gn/T/pip-record-O5uazE/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /Users/kasey/Library/Python/2.7/include/python2.7/psutil
           cwd: /private/var/folders/4h/g406694s1hb_rc1vwchcn08c0000gn/T/pip-install-HsBPVK/psutil/
      Complete output (43 lines):
      running install
      running build
      running build_py
      creating build
      creating build/lib.macosx-10.15-x86_64-2.7
      creating build/lib.macosx-10.15-x86_64-2.7/psutil
      copying psutil/_pswindows.py -&gt; build/lib.macosx-10.15-x86_64-2.7/psutil
      copying psutil/_common.py -&gt; build/lib.macosx-10.15-x86_64-2.7/psutil
      copying psutil/__init__.py -&gt; build/lib.macosx-10.15-x86_64-2.7/psutil
      copying psutil/_psosx.py -&gt; build/lib.macosx-10.15-x86_64-2.7/psutil
      copying psutil/_psbsd.py -&gt; build/lib.macosx-10.15-x86_64-2.7/psutil
      copying psutil/_psaix.py -&gt; build/lib.macosx-10.15-x86_64-2.7/psutil
      copying psutil/_pslinux.py -&gt; build/lib.macosx-10.15-x86_64-2.7/psutil
      copying psutil/_compat.py -&gt; build/lib.macosx-10.15-x86_64-2.7/psutil
      copying psutil/_psposix.py -&gt; build/lib.macosx-10.15-x86_64-2.7/psutil
      copying psutil/_pssunos.py -&gt; build/lib.macosx-10.15-x86_64-2.7/psutil
      creating build/lib.macosx-10.15-x86_64-2.7/psutil/tests
      copying psutil/tests/test_contracts.py -&gt; build/lib.macosx-10.15-x86_64-2.7/psutil/tests
      copying psutil/tests/test_connections.py -&gt; build/lib.macosx-10.15-x86_64-2.7/psutil/tests
      copying psutil/tests/runner.py -&gt; build/lib.macosx-10.15-x86_64-2.7/psutil/tests
      copying psutil/tests/test_unicode.py -&gt; build/lib.macosx-10.15-x86_64-2.7/psutil/tests
      copying psutil/tests/test_misc.py -&gt; build/lib.macosx-10.15-x86_64-2.7/psutil/tests
      copying psutil/tests/test_posix.py -&gt; build/lib.macosx-10.15-x86_64-2.7/psutil/tests
      copying psutil/tests/test_linux.py -&gt; build/lib.macosx-10.15-x86_64-2.7/psutil/tests
      copying psutil/tests/test_sunos.py -&gt; build/lib.macosx-10.15-x86_64-2.7/psutil/tests
      copying psutil/tests/__init__.py -&gt; build/lib.macosx-10.15-x86_64-2.7/psutil/tests
      copying psutil/tests/test_aix.py -&gt; build/lib.macosx-10.15-x86_64-2.7/psutil/tests
      copying psutil/tests/test_process.py -&gt; build/lib.macosx-10.15-x86_64-2.7/psutil/tests
      copying psutil/tests/test_bsd.py -&gt; build/lib.macosx-10.15-x86_64-2.7/psutil/tests
      copying psutil/tests/test_system.py -&gt; build/lib.macosx-10.15-x86_64-2.7/psutil/tests
      copying psutil/tests/test_osx.py -&gt; build/lib.macosx-10.15-x86_64-2.7/psutil/tests
      copying psutil/tests/test_memory_leaks.py -&gt; build/lib.macosx-10.15-x86_64-2.7/psutil/tests
      copying psutil/tests/test_windows.py -&gt; build/lib.macosx-10.15-x86_64-2.7/psutil/tests
      copying psutil/tests/__main__.py -&gt; build/lib.macosx-10.15-x86_64-2.7/psutil/tests
      running build_ext
      building 'psutil._psutil_osx' extension
      creating build/temp.macosx-10.15-x86_64-2.7
      creating build/temp.macosx-10.15-x86_64-2.7/psutil
      creating build/temp.macosx-10.15-x86_64-2.7/psutil/arch
      creating build/temp.macosx-10.15-x86_64-2.7/psutil/arch/osx
      cc -fno-strict-aliasing -fno-common -dynamic -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -iwithsysroot /usr/local/libressl/include -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch x86_64 -pipe -DPSUTIL_POSIX=1 -DPSUTIL_SIZEOF_PID_T=4 -DPSUTIL_VERSION=570 -DPSUTIL_OSX=1 -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c psutil/_psutil_common.c -o build/temp.macosx-10.15-x86_64-2.7/psutil/_psutil_common.o
      xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
      error: command 'cc' failed with exit status 1
      ----------------------------------------
  ERROR: Command errored out with exit status 1: /System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/4h/g406694s1hb_rc1vwchcn08c0000gn/T/pip-install-HsBPVK/psutil/setup.py'"'"'; __file__='"'"'/private/var/folders/4h/g406694s1hb_rc1vwchcn08c0000gn/T/pip-install-HsBPVK/psutil/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/4h/g406694s1hb_rc1vwchcn08c0000gn/T/pip-record-O5uazE/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /Users/kasey/Library/Python/2.7/include/python2.7/psutil Check the logs for full command output.
  </code></pre>