0

I'm quite a newbie so I apologise if this is a dumb question. I am trying to install the module osmnx, I ran:

pip3 install osmnx

and got the following error:

WARNING: Discarding https://files.pythonhosted.org/packages/3e/5f/0c6704efeea2ff3fba7f54cc6ec38070157f21bc1cffa7bdfa7c9f6b8f7a/Fiona-1.8.1.tar.gz#sha256=4c34bb4c5cd788aaf14e5484c3b7de407b1a8a7c7b2d29bbb2e8b37931e83b8d (from https://pypi.org/simple/fiona/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
  Using cached Fiona-1.8.0.tar.gz (1.4 MB)
  Preparing metadata (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /Library/Frameworks/Python.framework/Versions/3.10/bin/python3.10 -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/1x/7bqv5_f94mq77y5n3tjh6stw0000gn/T/pip-install-wykkzzn9/fiona_69beb180c4044ee4a9efa841cc4afc4f/setup.py'"'"'; __file__='"'"'/private/var/folders/1x/7bqv5_f94mq77y5n3tjh6stw0000gn/T/pip-install-wykkzzn9/fiona_69beb180c4044ee4a9efa841cc4afc4f/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /private/var/folders/1x/7bqv5_f94mq77y5n3tjh6stw0000gn/T/pip-pip-egg-info-hqmq2c3k
       cwd: /private/var/folders/1x/7bqv5_f94mq77y5n3tjh6stw0000gn/T/pip-install-wykkzzn9/fiona_69beb180c4044ee4a9efa841cc4afc4f/
  Complete output (2 lines):
  Failed to get options via gdal-config: [Errno 2] No such file or directory: 'gdal-config'
  A GDAL API version must be specified. Provide a path to gdal-config using a GDAL_CONFIG environment variable or use a GDAL_VERSION environment variable.
  ----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/2a/bd/c1efc2680f338e5941121c776d6323af6b9698ac739e22ba523cee348a7f/Fiona-1.8.0.tar.gz#sha256=20141a9ece06daa7bb4333fba640c2fe39a49f8aca5492d1da8595d41e91844a (from https://pypi.org/simple/fiona/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
Collecting geopandas>=0.10
  Using cached geopandas-0.11.0-py3-none-any.whl (1.0 MB)
  Using cached geopandas-0.10.2-py2.py3-none-any.whl (1.0 MB)
  Using cached geopandas-0.10.1-py2.py3-none-any.whl (1.0 MB)
  Using cached geopandas-0.10.0-py2.py3-none-any.whl (1.0 MB)
INFO: pip is looking at multiple versions of <Python from Requires-Python> to determine which version is compatible with other requirements. This could take a while.
INFO: pip is looking at multiple versions of osmnx to determine which version is compatible with other requirements. This could take a while.
Collecting osmnx
  Using cached osmnx-1.2.0-py2.py3-none-any.whl (92 kB)
  Using cached osmnx-1.1.2-py2.py3-none-any.whl (95 kB)
  Using cached osmnx-1.1.1-py2.py3-none-any.whl (93 kB)
Collecting geopandas>=0.9
  Using cached geopandas-0.9.0-py2.py3-none-any.whl (994 kB)
Collecting osmnx
  Using cached osmnx-1.1.0-py2.py3-none-any.whl (91 kB)
  Using cached osmnx-1.0.1-py2.py3-none-any.whl (87 kB)
Collecting descartes>=1.1
  Using cached descartes-1.1.0-py3-none-any.whl (5.8 kB)
Collecting geopandas>=0.8
  Using cached geopandas-0.8.2-py2.py3-none-any.whl (962 kB)
Collecting fiona
  Using cached Fiona-1.7.13.tar.gz (731 kB)
  Preparing metadata (setup.py) ... done
Requirement already satisfied: cligj>=0.4 in /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages (from fiona->geopandas>=0.8->osmnx) (0.7.2)
Requirement already satisfied: click-plugins in /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages (from fiona->geopandas>=0.8->osmnx) (1.1.1)
Requirement already satisfied: six>=1.7 in /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages (from fiona->geopandas>=0.8->osmnx) (1.16.0)
Requirement already satisfied: munch in /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages (from fiona->geopandas>=0.8->osmnx) (2.5.0)
Requirement already satisfied: packaging>=20.0 in /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages (from matplotlib>=3.5->osmnx) (21.3)
Requirement already satisfied: python-dateutil>=2.7 in /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages (from matplotlib>=3.5->osmnx) (2.8.2)
Requirement already satisfied: pillow>=6.2.0 in /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages (from matplotlib>=3.5->osmnx) (9.2.0)
Requirement already satisfied: pyparsing>=2.2.1 in /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages (from matplotlib>=3.5->osmnx) (3.0.9)
Requirement already satisfied: cycler>=0.10 in /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages (from matplotlib>=3.5->osmnx) (0.11.0)
Requirement already satisfied: kiwisolver>=1.0.1 in /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages (from matplotlib>=3.5->osmnx) (1.4.4)
Requirement already satisfied: fonttools>=4.22.0 in /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages (from matplotlib>=3.5->osmnx) (4.34.4)
Requirement already satisfied: pytz>=2020.1 in /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages (from pandas>=1.4->osmnx) (2022.1)
Requirement already satisfied: certifi in /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages (from pyproj>=3.3->osmnx) (2022.6.15)
Collecting charset-normalizer<3,>=2
  Using cached charset_normalizer-2.1.0-py3-none-any.whl (39 kB)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages (from requests>=2.27->osmnx) (1.26.11)
Requirement already satisfied: idna<4,>=2.5 in /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages (from requests>=2.27->osmnx) (3.3)
Requirement already satisfied: click>=4.0 in /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages (from cligj>=0.4->fiona->geopandas>=0.8->osmnx) (8.1.3)
Using legacy 'setup.py install' for fiona, since package 'wheel' is not installed.
Installing collected packages: fiona, charset-normalizer, Rtree, requests, geopandas, descartes, osmnx
    Running setup.py install for fiona ... error
    ERROR: Command errored out with exit status 1:
     command: /Library/Frameworks/Python.framework/Versions/3.10/bin/python3.10 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/1x/7bqv5_f94mq77y5n3tjh6stw0000gn/T/pip-install-wykkzzn9/fiona_6c86062e72e74e1c9684aa97ff38c3ab/setup.py'"'"'; __file__='"'"'/private/var/folders/1x/7bqv5_f94mq77y5n3tjh6stw0000gn/T/pip-install-wykkzzn9/fiona_6c86062e72e74e1c9684aa97ff38c3ab/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/1x/7bqv5_f94mq77y5n3tjh6stw0000gn/T/pip-record-y4iy2p0r/install-record.txt --single-version-externally-managed --compile --install-headers /Library/Frameworks/Python.framework/Versions/3.10/include/python3.10/fiona
         cwd: /private/var/folders/1x/7bqv5_f94mq77y5n3tjh6stw0000gn/T/pip-install-wykkzzn9/fiona_6c86062e72e74e1c9684aa97ff38c3ab/
    Complete output (50 lines):
    Failed to get options via gdal-config: [Errno 2] No such file or directory: 'gdal-config'
    /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/dist.py:274: UserWarning: Unknown distribution option: 'metadata_version'
      warnings.warn(msg)
    /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/dist.py:274: UserWarning: Unknown distribution option: 'requires_python'
      warnings.warn(msg)
    /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/dist.py:274: UserWarning: Unknown distribution option: 'requires_external'
      warnings.warn(msg)
    running install
    running build
    running build_py
    creating build
    creating build/lib.macosx-10.9-universal2-3.10
    creating build/lib.macosx-10.9-universal2-3.10/fiona
    copying ./fiona/compat.py -> build/lib.macosx-10.9-universal2-3.10/fiona
    copying ./fiona/drvsupport.py -> build/lib.macosx-10.9-universal2-3.10/fiona
    copying ./fiona/inspector.py -> build/lib.macosx-10.9-universal2-3.10/fiona
    copying ./fiona/__init__.py -> build/lib.macosx-10.9-universal2-3.10/fiona
    copying ./fiona/crs.py -> build/lib.macosx-10.9-universal2-3.10/fiona
    copying ./fiona/rfc3339.py -> build/lib.macosx-10.9-universal2-3.10/fiona
    copying ./fiona/transform.py -> build/lib.macosx-10.9-universal2-3.10/fiona
    copying ./fiona/collection.py -> build/lib.macosx-10.9-universal2-3.10/fiona
    copying ./fiona/errors.py -> build/lib.macosx-10.9-universal2-3.10/fiona
    copying ./fiona/tool.py -> build/lib.macosx-10.9-universal2-3.10/fiona
    creating build/lib.macosx-10.9-universal2-3.10/fiona/fio
    copying ./fiona/fio/options.py -> build/lib.macosx-10.9-universal2-3.10/fiona/fio
    copying ./fiona/fio/collect.py -> build/lib.macosx-10.9-universal2-3.10/fiona/fio
    copying ./fiona/fio/distrib.py -> build/lib.macosx-10.9-universal2-3.10/fiona/fio
    copying ./fiona/fio/env.py -> build/lib.macosx-10.9-universal2-3.10/fiona/fio
    copying ./fiona/fio/insp.py -> build/lib.macosx-10.9-universal2-3.10/fiona/fio
    copying ./fiona/fio/cat.py -> build/lib.macosx-10.9-universal2-3.10/fiona/fio
    copying ./fiona/fio/__init__.py -> build/lib.macosx-10.9-universal2-3.10/fiona/fio
    copying ./fiona/fio/ls.py -> build/lib.macosx-10.9-universal2-3.10/fiona/fio
    copying ./fiona/fio/dump.py -> build/lib.macosx-10.9-universal2-3.10/fiona/fio
    copying ./fiona/fio/calc.py -> build/lib.macosx-10.9-universal2-3.10/fiona/fio
    copying ./fiona/fio/filter.py -> build/lib.macosx-10.9-universal2-3.10/fiona/fio
    copying ./fiona/fio/load.py -> build/lib.macosx-10.9-universal2-3.10/fiona/fio
    copying ./fiona/fio/main.py -> build/lib.macosx-10.9-universal2-3.10/fiona/fio
    copying ./fiona/fio/info.py -> build/lib.macosx-10.9-universal2-3.10/fiona/fio
    copying ./fiona/fio/helpers.py -> build/lib.macosx-10.9-universal2-3.10/fiona/fio
    copying ./fiona/fio/bounds.py -> build/lib.macosx-10.9-universal2-3.10/fiona/fio
    running build_ext
    building 'fiona._transform' extension
    creating build/temp.macosx-10.9-universal2-3.10
    creating build/temp.macosx-10.9-universal2-3.10/fiona
    clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch arm64 -arch x86_64 -g -I/Library/Frameworks/Python.framework/Versions/3.10/include/python3.10 -c fiona/_transform.cpp -o build/temp.macosx-10.9-universal2-3.10/fiona/_transform.o
    fiona/_transform.cpp:606:10: fatal error: 'cpl_conv.h' file not found
    #include "cpl_conv.h"
             ^~~~~~~~~~~~
    1 error generated.
    error: command '/usr/bin/clang' failed with exit code 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /Library/Frameworks/Python.framework/Versions/3.10/bin/python3.10 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/1x/7bqv5_f94mq77y5n3tjh6stw0000gn/T/pip-install-wykkzzn9/fiona_6c86062e72e74e1c9684aa97ff38c3ab/setup.py'"'"'; __file__='"'"'/private/var/folders/1x/7bqv5_f94mq77y5n3tjh6stw0000gn/T/pip-install-wykkzzn9/fiona_6c86062e72e74e1c9684aa97ff38c3ab/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/1x/7bqv5_f94mq77y5n3tjh6stw0000gn/T/pip-record-y4iy2p0r/install-record.txt --single-version-externally-managed --compile --install-headers /Library/Frameworks/Python.framework/Versions/3.10/include/python3.10/fiona Check the logs for full command output.
WARNING: You are using pip version 21.3.1; however, version 22.2.1 is available.
You should consider upgrading via the '/Library/Frameworks/Python.framework/Versions/3.10/bin/python3.10 -m pip install --upgrade pip' command.

I have no clue what the error code is saying. I tried upgrading my pip version as suggested, but to no avail. My python version is 3.10.5 FYI. Could anyone please help me with this error?

Ken
  • 49
  • 5
  • [This thread](https://stackoverflow.com/questions/54734667/error-installing-geopandas-a-gdal-api-version-must-be-specified-in-anaconda) is related – Telinov Dmitri Aug 01 '22 at 14:39
  • https://github.com/Toblerity/Fiona/issues/601#issuecomment-403605747 Found in https://www.google.com/search?hl=ru&q=%22fatal+error%3A+cpl_conv.h+file+not+found%22 – phd Aug 01 '22 at 15:02
  • https://gdal.org/download.html – phd Aug 01 '22 at 15:03
  • 2
    You did not follow OSMnx's installation instructions. Easily fixed if you do: https://osmnx.readthedocs.io/en/stable/index.html#installation – gboeing Aug 01 '22 at 15:31
  • @gboeing thank you, you are right, i shouldn't have assumed everything can be installed by pip – Ken Aug 01 '22 at 15:58

0 Answers0