Skip to content

Instantly share code, notes, and snippets.

@moosetraveller
Last active July 19, 2022 19:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save moosetraveller/dcc0f5bb76a071195b86959b8ab036c8 to your computer and use it in GitHub Desktop.
Save moosetraveller/dcc0f5bb76a071195b86959b8ab036c8 to your computer and use it in GitHub Desktop.
ArcGIS API for Python installation fails

If you receive the error shown below (or similar) when installing the arcgis package with pip, then you need to install the system component libkrb5-dev:

  • Run sudo apt install libkrb5-dev
  • Rerun pip install arcgis
Collecting gssapi
  Using cached gssapi-1.7.3.tar.gz (1.3 MB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [14 lines of output]
      In distributed package, building from C files...
      /bin/sh: 1: krb5-config: not found
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/tmp/pip-install-vuoxyh7g/gssapi_2bf1b86e891d4a719a9517292f369a57/setup.py", line 128, in <module>
          link_args = shlex.split(get_output(f"{kc} --libs gssapi"))
        File "/tmp/pip-install-vuoxyh7g/gssapi_2bf1b86e891d4a719a9517292f369a57/setup.py", line 41, in get_output
          res = subprocess.check_output(*args, shell=True, **kwargs)
        File "/home/thozub/.pyenv/versions/3.9.13/lib/python3.9/subprocess.py", line 424, in check_output
          return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
        File "/home/thozub/.pyenv/versions/3.9.13/lib/python3.9/subprocess.py", line 528, in run
          raise CalledProcessError(retcode, process.args,
      subprocess.CalledProcessError: Command 'krb5-config --libs gssapi' returned non-zero exit status 127.
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

If an error occurs when youinstall krb5-config, you should do:

  1. sudo apt-get update
  2. sudo apt --fix-broken install
  3. sudo apt install libkrb5-dev
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment