pyTMD
pyTMD copied to clipboard
NameError: name 'ipyleaflet' is not defined
I am trying to get using Plot Tide Forecast.ipynb to get a time series of the earth and ocean tide at a certain point, but in string:
m = pyTMD.tools.leaflet(center=(LAT,LON), zoom=3,
zoom_control=True, marker_control=True)
I ran into the following problem:
NameError Traceback (most recent call last)
Cell In[3], [line 3](vscode-notebook-cell:?execution_count=3&line=3)
[1](vscode-notebook-cell:?execution_count=3&line=1) # default coordinates to use
[2](vscode-notebook-cell:?execution_count=3&line=2) LAT,LON = (-76.0, -40.0)
----> [3](vscode-notebook-cell:?execution_count=3&line=3) m = pyTMD.tools.leaflet(center=(LAT,LON), zoom=3,
[4](vscode-notebook-cell:?execution_count=3&line=4) zoom_control=True, marker_control=True)
[5](vscode-notebook-cell:?execution_count=3&line=5) # show map
[6](vscode-notebook-cell:?execution_count=3&line=6) m.map
File [~/bin/jupiter/.venv/lib/python3.10/site-packages/pyTMD-2.1.1.dev3](https://untitled+.vscode-resource.vscode-cdn.net/~/bin/jupiter/.venv/lib/python3.10/site-packages/pyTMD-2.1.1.dev3)+gef78f74-py3.10.egg/pyTMD/tools.py:217, in leaflet.__init__(self, projection, **kwargs)
[215](https://untitled+.vscode-resource.vscode-cdn.net/~/bin/jupiter/.venv/lib/python3.10/site-packages/pyTMD-2.1.1.dev3+gef78f74-py3.10.egg/pyTMD/tools.py:215) # create basemap in projection
[216](https://untitled+.vscode-resource.vscode-cdn.net/~/bin/jupiter/.venv/lib/python3.10/site-packages/pyTMD-2.1.1.dev3+gef78f74-py3.10.egg/pyTMD/tools.py:216) if (projection == 'Global'):
--> [217](https://untitled+.vscode-resource.vscode-cdn.net/~/bin/jupiter/.venv/lib/python3.10/site-packages/pyTMD-2.1.1.dev3+gef78f74-py3.10.egg/pyTMD/tools.py:217) self.map = ipyleaflet.Map(center=kwargs['center'],
[218](https://untitled+.vscode-resource.vscode-cdn.net/~/bin/jupiter/.venv/lib/python3.10/site-packages/pyTMD-2.1.1.dev3+gef78f74-py3.10.egg/pyTMD/tools.py:218) zoom=kwargs['zoom'], max_zoom=15, world_copy_jump=True,
[219](https://untitled+.vscode-resource.vscode-cdn.net/~/bin/jupiter/.venv/lib/python3.10/site-packages/pyTMD-2.1.1.dev3+gef78f74-py3.10.egg/pyTMD/tools.py:219) attribution_control=kwargs['attribution'],
[220](https://untitled+.vscode-resource.vscode-cdn.net/~/bin/jupiter/.venv/lib/python3.10/site-packages/pyTMD-2.1.1.dev3+gef78f74-py3.10.egg/pyTMD/tools.py:220) basemap=ipyleaflet.basemaps.Esri.WorldTopoMap)
[221](https://untitled+.vscode-resource.vscode-cdn.net/~/bin/jupiter/.venv/lib/python3.10/site-packages/pyTMD-2.1.1.dev3+gef78f74-py3.10.egg/pyTMD/tools.py:221) self.crs = 'EPSG:3857'
[222](https://untitled+.vscode-resource.vscode-cdn.net/~/bin/jupiter/.venv/lib/python3.10/site-packages/pyTMD-2.1.1.dev3+gef78f74-py3.10.egg/pyTMD/tools.py:222) elif (projection == 'North'):
NameError: name 'ipyleaflet' is not defined
What could be the problem? There were no problems when installing pyTMD. I am grateful in advance for any help!
Hi @glukvit!
As part of #156 and other issues, I removed dependencies that were part of the example notebooks but not needed as part of the "core code". These are now listed in the documentation as "Optional Dependencies". I think if you still build using environment.yml you can get the full build. Sorry for the trouble!!