Installing but OSMnx in new Environment: Fiona Error-- module 'fiona' has no attribute '_loading'

489 Views Asked by At

I am installing OSMnx in a new environment following the steps from Geoffboeing's site: https://geoffboeing.com/2017/02/python-getting-started/

After activating the environment and importing the OSMnx module, it gives me the error of fiona

AttributeError                            Traceback (most recent call last)
<ipython-input-2-28b0d4205d5c> in <module>()
----> 1 import osmnx as ox
      2 get_ipython().magic('matplotlib inline')
      3 #import geopandas as gpd

C:\Users\Kirti\anaconda3\envs\ox\lib\site-packages\osmnx\__init__.py in <module>()
      7 ################################################################################
      8 
----> 9 from .buildings import *
     10 from .elevation import *
     11 from .core import *

C:\Users\Kirti\anaconda3\envs\ox\lib\site-packages\osmnx\buildings.py in <module>()
      7 
      8 import time
----> 9 import geopandas as gpd
     10 import matplotlib.pyplot as plt
     11 from matplotlib.collections import PatchCollection

C:\Users\Kirti\anaconda3\envs\ox\lib\site-packages\geopandas\__init__.py in <module>()
      5 from geopandas.array import points_from_xy  # noqa
      6 
----> 7 from geopandas.io.file import _read_file as read_file  # noqa
      8 from geopandas.io.arrow import _read_parquet as read_parquet  # noqa
      9 from geopandas.io.arrow import _read_feather as read_feather  # noqa

C:\Users\Kirti\anaconda3\envs\ox\lib\site-packages\geopandas\io\file.py in <module>()
     10 
     11 try:
---> 12     import fiona
     13 
     14     fiona_import_error = None

C:\Users\Kirti\anaconda3\envs\ox\lib\site-packages\fiona\__init__.py in <module>()
     83 
     84 import fiona._loading
---> 85 with fiona._loading.add_gdal_dll_directories():
     86     from fiona.collection import BytesCollection, Collection
     87     from fiona.drvsupport import supported_drivers

AttributeError: module 'fiona' has no attribute '_loading'

I am trying to install OSMnx past a week but still couldn't

  1. Installed only from one channel Conda forge
  2. This is fresh, installed anaconda all over again
  3. So, no old modules clashing
  4. New environment

Before going any further with installation of single module separately then causing version clashes between GDAL & others. I want to ask if anybody has a solution or how can I do it?

I took care of almost all measures but still no to avail. I am new to this and I am not sure with downloading .whl files and stuff.

Here, is my conda list in this environment

enter image description here

enter image description here

enter image description here

enter image description here

enter image description here

Python Version is: Python 3.9.0 (in that environment)

Thank you in advance.

1

There are 1 best solutions below

0
On

If you want to install OSMnx, just follow its current documented installation instructions. Blog posts can fall out-of-date over the years.