geocompx / geocompy

Geocomputation with Python: an open source book
https://py.geocompx.org/
Other
270 stars 49 forks source link

Evaluate all relevant lines in c2 #20

Closed Robinlovelace closed 2 years ago

Robinlovelace commented 2 years ago

E.g.

https://github.com/geocompr/py/blob/c4cea549ff5b17e93857d68072d332a0d34b730a/02-spatial-data.qmd#L90

Robinlovelace commented 2 years ago

Without the build failing. Depends on upstream fixes, that should be ready to go: https://github.com/geocompr/docker/issues/23

Robinlovelace commented 2 years ago

Currently getting this error message, heads up @anitagraser. Will try to add the relevant pkgs to the Docker image. Idea: could we use the pip deps.txt file as an input into the docker container?

An error occurred while executing the following cell:
------------------
import hvplot.pandas
dat.hvplot()
------------------

---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
File /usr/local/lib/python3.8/dist-packages/cartopy/img_transform.py:14, in <module>
     13 try:
---> 14     import pykdtree.kdtree
     15     _is_pykdtree = True

ModuleNotFoundError: No module named 'pykdtree'

During handling of the above exception, another exception occurred:

ModuleNotFoundError                       Traceback (most recent call last)
File /usr/local/lib/python3.8/dist-packages/cartopy/img_transform.py:18, in <module>
     17 try:
---> 18     import scipy.spatial
     19 except ImportError as e:

ModuleNotFoundError: No module named 'scipy'

The above exception was the direct cause of the following exception:

ImportError                               Traceback (most recent call last)
File /usr/local/lib/python3.8/dist-packages/hvplot/converter.py:353, in HoloViewsConverter.__init__(self, data, x, y, kind, by, use_index, group_label, value_label, backlog, persist, use_dask, crs, fields, groupby, dynamic, grid, legend, rot, title, xlim, ylim, clim, symmetric, logx, logy, loglog, hover, subplots, label, invert, stacked, colorbar, datashade, rasterize, row, col, figsize, debug, framewise, aggregator, projection, global_extent, geo, precompute, flip_xaxis, flip_yaxis, dynspread, hover_cols, x_sampling, y_sampling, project, tools, attr_labels, coastline, tiles, sort_date, check_symmetric_max, transforms, stream, cnorm, features, **kwds)
    352 try:
--> 353     import geoviews # noqa
    354 except ImportError:

File /usr/local/lib/python3.8/dist-packages/geoviews/__init__.py:13, in <module>
     11     pass
---> 13 from .annotators import annotate # noqa (API import)
     14 from .element import ( # noqa (API import)
     15     _Element, Feature, Tiles, WMTS, LineContours, FilledContours,
     16     Text, Image, Points, Path, Polygons, Shape, Dataset, RGB,
     17     Contours, Graph, TriMesh, Nodes, EdgePaths, QuadMesh, VectorField,
     18     HexTiles, Labels, Rectangles, Segments
     19 )

File /usr/local/lib/python3.8/dist-packages/geoviews/annotators.py:15, in <module>
     14 from .links import VertexTableLink, PointTableLink, HvRectanglesTableLink, RectanglesTableLink
---> 15 from .operation import project
     16 from .streams import PolyVertexDraw, PolyVertexEdit

File /usr/local/lib/python3.8/dist-packages/geoviews/operation/__init__.py:7, in <module>
      6 from ..element import _Element
----> 7 from .projection import ( # noqa (API import)
      8     project_image, project_path, project_shape, project_points,
      9     project_graph, project_quadmesh, project_geom, project)
     10 from .resample import resample_geometry # noqa (API import)

File /usr/local/lib/python3.8/dist-packages/geoviews/operation/projection.py:8, in <module>
      7 from cartopy import crs as ccrs
----> 8 from cartopy.img_transform import warp_array, _determine_bounds
      9 from holoviews.core.data import MultiInterface

File /usr/local/lib/python3.8/dist-packages/cartopy/img_transform.py:20, in <module>
     19 except ImportError as e:
---> 20     raise ImportError("Using image transforms requires either "
     21                       "pykdtree or scipy.") from e
     22 _is_pykdtree = False

ImportError: Using image transforms requires either pykdtree or scipy.

During handling of the above exception, another exception occurred:

ImportError                               Traceback (most recent call last)
Input In [8], in <cell line: 2>()
      1 import hvplot.pandas
----> 2 dat.hvplot()

File /usr/local/lib/python3.8/dist-packages/hvplot/plotting/core.py:79, in hvPlotBase.__call__(self, x, y, kind, **kwds)
     76         plot = self._get_converter(x, y, kind, **kwds)(kind, x, y)
     77         return pn.panel(plot, **panel_dict)
---> 79 return self._get_converter(x, y, kind, **kwds)(kind, x, y)

File /usr/local/lib/python3.8/dist-packages/hvplot/plotting/core.py:86, in hvPlotBase._get_converter(self, x, y, kind, **kwds)
     84 y = y or params.pop('y', None)
     85 kind = kind or params.pop('kind', None)
---> 86 return HoloViewsConverter(
     87     self._data, x, y, kind=kind, **params
     88 )

File /usr/local/lib/python3.8/dist-packages/hvplot/converter.py:355, in HoloViewsConverter.__init__(self, data, x, y, kind, by, use_index, group_label, value_label, backlog, persist, use_dask, crs, fields, groupby, dynamic, grid, legend, rot, title, xlim, ylim, clim, symmetric, logx, logy, loglog, hover, subplots, label, invert, stacked, colorbar, datashade, rasterize, row, col, figsize, debug, framewise, aggregator, projection, global_extent, geo, precompute, flip_xaxis, flip_yaxis, dynspread, hover_cols, x_sampling, y_sampling, project, tools, attr_labels, coastline, tiles, sort_date, check_symmetric_max, transforms, stream, cnorm, features, **kwds)
    353         import geoviews # noqa
    354     except ImportError:
--> 355         raise ImportError('In order to use geo-related features '
    356                           'the geoviews library must be available. '
    357                           'It can be installed with:\n  conda '
    358                           'install -c pyviz geoviews')
    359 if self.geo:
    360     if self.kind not in self._geo_types:

ImportError: In order to use geo-related features the geoviews library must be available. It can be installed with:
  conda install -c pyviz geoviews
ImportError: In order to use geo-related features the geoviews library must be available. It can be installed with:
  conda install -c pyviz geoviews

There is a environment.yml file in this directory. Is this for a conda env that you need to restore?

Error: Process completed with exit code 1.