How to solve Binder error message for OSMnx?

190 Views Asked by At

I'm trying to use OSMnx in binder but get an error message:

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
/tmp/ipykernel_120/2784735849.py in <module>
      1 import networkx as nx
----> 2 import osmnx as ox
      3 
      4 get_ipython().run_line_magic('matplotlib', 'inline')
      5 ox.config(log_console=True)

/srv/conda/envs/notebook/site-packages/osmnx/__init__.py in <module>
      1 """OSMnx init."""
      2 
----> 3 from ._api import *
      4 from ._version import __version__

/srv/conda/envs/notebook/site-packages/osmnx/_api.py in <module>
      1 """Expose most common parts of public API directly in `osmnx.` namespace."""
      2 
----> 3 from .bearing import add_edge_bearings
      4 from .bearing import orientation_entropy
      5 from .bearing import plot_orientation

/srv/conda/envs/notebook/site-packages/osmnx/bearing.py in <module>
      3 import warnings
      4 
----> 5 import matplotlib.pyplot as plt
      6 import networkx as nx
      7 import numpy as np

/srv/conda/envs/notebook/site-packages/matplotlib/__init__.py in <module>
    105 # cbook must import matplotlib only within function
    106 # definitions, so it is safe to import from it here.
--> 107 from . import _api, cbook, docstring, rcsetup
    108 from matplotlib.cbook import MatplotlibDeprecationWarning, sanitize_sequence
    109 from matplotlib.cbook import mplDeprecation  # deprecated

/srv/conda/envs/notebook/site-packages/matplotlib/rcsetup.py in <module>
     22 import numpy as np
     23 
---> 24 from matplotlib import _api, animation, cbook
     25 from matplotlib.cbook import ls_mapper
     26 from matplotlib.colors import Colormap, is_color_like

/srv/conda/envs/notebook/site-packages/matplotlib/animation.py in <module>
     32 
     33 import numpy as np
---> 34 from PIL import Image
     35 
     36 import matplotlib as mpl

/srv/conda/envs/notebook/site-packages/PIL/Image.py in <module>
    112     # Also note that Image.core is not a publicly documented interface,
    113     # and should be considered private and subject to change.
--> 114     from . import _imaging as core
    115 
    116     if __version__ != getattr(core, "PILLOW_VERSION", None):

ImportError: cannot import name '_imaging'

This happens when I try to create my own binder, but also if I use the one from Geoff himself: https://mybinder.org/v2/gh/gboeing/osmnx-examples/main?urlpath=lab it occurs when running the first block for example in this example notebook: OSMnx features demo

Update: Using the previous version of OSMnx (1.0.1) 'solves' the issue (meaning with that version I don't get the error message)

0

There are 0 best solutions below