0

I am trying to install OSMNX module in Pycharm (using Python 3.7.2). I tried installing it using pip install osmnx but got the following error[![error][1]][1] i have also tried using .whl files from [https://www.lfd.uci.edu/~gohlke/pythonlibs/#fiona][2] but I cannot identify how/what steps to follow. Please provide some clear steps!

Most of the other question are answered w.r.t. conda environment. I have to use Pcharm only.

Input in any form is highly appreciated! [1]: https://i.stack.imgur.com/RdJDN.png [2]: https://www.lfd.uci.edu/~gohlke/pythonlibs/#fiona

  • The order you install the gis libraries matters. I use the order gdal, friona, shapely. – dubbbdan Aug 25 '20 at 15:21
  • @dubbbdan Please provide steps to install gdal , fiona in Pycharm because Pycharm gives error when I install normally? – Prateek Agarwal Aug 25 '20 at 15:22
  • I am using gdal version `2040100`, fiona version `1.8.6` and shapely version `1.7.0` – dubbbdan Aug 25 '20 at 15:24
  • Versions of Gdal available in Pcharm are 3. something. What is this 2040100? And more specifically how do you install gdal and fiona when Pycahrm gives error ? – Prateek Agarwal Aug 25 '20 at 15:27
  • I dont use pycharm. There might be another combination of verstions that work on py 3.7, but thats what i would look for. – dubbbdan Aug 25 '20 at 15:28
  • The wheel i have is named `GDAL-2.4.1-cp37-cp37m-win_amd64.whl`. I don't see it available on Chris Gohlke's site anymore. I am not sure who else serves those data. – dubbbdan Aug 25 '20 at 15:30
  • Oh thanks but I want answers wrt Pycharm only. If there is any way to resolve this issue in Pycharm kindly let me know – Prateek Agarwal Aug 25 '20 at 15:35
  • Your issue has nothing to do with PyCharm. It has everything to do with how the GIS libraries link together in your environment. – dubbbdan Aug 25 '20 at 15:44

1 Answers1

1

You said:

I have to use Pcharm only.

Does that mean you cannot use conda + pycharm on your system for some reason? If you can, then:

  1. Install OSMnx with conda
  2. Use Conda environment in pycharm

This is by far the easiest (and recommended) solution. If you cannot, then you must manually install the dependencies. This is a nontrivial process, especially if you're on Windows. OSMnx itself is pure Python and its installation is simple, but its dependencies have C extensions that require compilation.

You can see OSMnx's dependencies here and you'll have to install them one at a time. All of the tricky dependencies are brought in via geopandas, and you can read more about its installation details and dependencies here.

gboeing
  • 5,691
  • 2
  • 15
  • 41