You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Was copy-editing the PySAL Notebooks (https://pysal.org/notebooks/intro) and encountered semi-regular import errors when trying to run the Notebooks via 'Interact' feature of Jupyter Book. For example, on the first esda notebook Spatial_Autocorrelation_for_Areal_Unit_Data), the first chunk enouncters an error when trying to import relevant modules:
import sys
import os
sys.path.append(os.path.abspath('..'))
from pysal.explore import esda
ModuleNotFoundError Traceback (most recent call last)
in
2 import os
3 sys.path.append(os.path.abspath('..'))
----> 4 from pysal.explore import esda
/opt/conda/lib/python3.7/site-packages/pysal/init.py in
1 version = '2.2.1'
----> 2 from . import lib
3 from . import explore
4 from . import viz
5 from . import model
/opt/conda/lib/python3.7/site-packages/pysal/lib/init.py in
26 """
27
---> 28 from libpysal import cg
29 from libpysal import io
30 from libpysal import weights
ModuleNotFoundError: No module named 'libpysal'
A quick reinstall and alternative loading of esda & libpysal allows the notebook to be run without error once a few import lines are edited throughout the notebook:
# Add these commands to top of notebook
!pip install esda
import esda as esda
!pip install libpysal
import libpysal as lps
Remove:
from pysal.explore import esda #from second chunk
import pysal.lib as lps #from third chunk
from pysal.explore import esda #from ~20th chunk
from pysal.explore import esda #from ~35th chunk
Lastly, change: from pysal.viz import mapclassify as mc to import mapclassify as mc
Is this issue due to a setting in Jupyter Book or Binder? Or simply some import commands that needed to be updated?
The text was updated successfully, but these errors were encountered:
jeffcsauer
changed the title
Small import error when interacting with ESDA notebook
Module import errors when using Jupyter Book 'Interact' feature (ESDA notebook as a start)
Mar 21, 2020
Hi all,
Was copy-editing the PySAL Notebooks (https://pysal.org/notebooks/intro) and encountered semi-regular import errors when trying to run the Notebooks via 'Interact' feature of Jupyter Book. For example, on the first
esda
notebook Spatial_Autocorrelation_for_Areal_Unit_Data), the first chunk enouncters an error when trying to import relevant modules:A quick reinstall and alternative loading of esda & libpysal allows the notebook to be run without error once a few import lines are edited throughout the notebook:
Remove:
Lastly, change:
from pysal.viz import mapclassify as mc
toimport mapclassify as mc
Is this issue due to a setting in Jupyter Book or Binder? Or simply some import commands that needed to be updated?
The text was updated successfully, but these errors were encountered: