Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

get_leaflet_tile_layer error (v0.3.13) #45

Closed
giswqs opened this issue Dec 30, 2021 · 9 comments · Fixed by #46
Closed

get_leaflet_tile_layer error (v0.3.13) #45

giswqs opened this issue Dec 30, 2021 · 9 comments · Fixed by #46

Comments

@giswqs
Copy link

giswqs commented Dec 30, 2021

Both v0.3.13 and the GitHub source throws the same error when using the example. v0.3.12 works fine.

from localtileserver import get_leaflet_tile_layer, TileClient
from ipyleaflet import Map

# First, create a tile server from local raster file
tile_client = TileClient('~/Downloads/dem.tif')

# Create ipyleaflet tile layer from that server
t = get_leaflet_tile_layer(tile_client)

# Create ipyleaflet map, add tile layer, and display
m = Map(center=tile_client.center())
m.add_layer(t)
m

v0.3.13
image

v0.3.12
image

@banesullivan
Copy link
Owner

Is this Python 3.6?

@giswqs
Copy link
Author

giswqs commented Dec 30, 2021

It is Python 3.8. You can see the Python path in the error screenshot.

@banesullivan
Copy link
Owner

Can you share a report

import localtileserver
print(localtileserver.Report())

@giswqs
Copy link
Author

giswqs commented Dec 30, 2021

Everything works fine when I downgraded localtileserver to v0.3.12.


--------------------------------------------------------------------------------
  Date: Wed Dec 29 22:20:46 2021 EST

                     OS : Linux
                 CPU(s) : 8
                Machine : x86_64
           Architecture : 64bit
                    RAM : 31.2 GiB
            Environment : Jupyter
            File system : ext4

  Python 3.8.5 (default, Sep  4 2020, 07:30:14)  [GCC 7.3.0]

        localtileserver : 0.3.13
                  flask : 2.0.2
          flask_caching : 1.10.1
            flask_restx : 0.5.1
               requests : 2.26.0
               werkzeug : 2.0.2
                  click : 7.1.2
                 scooby : 0.5.9
            large_image : 1.8.7
large_image_source_gdal : 1.8.7
             cachetools : 4.1.1
                    PIL : 8.0.1
                 psutil : 5.7.2
                  numpy : 1.20.1
             palettable : 3.3.0
                 pyproj : 3.0.1
             osgeo.gdal : 3.2.1
               gunicorn : 20.1.0
             ipyleaflet : 0.15.0
                shapely : 1.7.1
                 folium : 0.12.1.post1
             matplotlib : 3.3.2

@banesullivan
Copy link
Owner

Sorry, can you actually share the whole env? With either pip list or conda list. I need info on traitlets which isn't covered in the report

@giswqs
Copy link
Author

giswqs commented Dec 30, 2021

Sorry for the long list. My env has a long history.

Package                           Version             Location
--------------------------------- ------------------- ----------------------------------------------------------
affine                            2.3.0
aiohttp                           3.7.2
alabaster                         0.7.12
altair                            4.1.0
aniso8601                         9.0.1
anyio                             3.3.2
appdirs                           1.4.4
argon2-cffi                       20.1.0
arrow                             0.17.0
astor                             0.8.1
astroid                           2.4.2
asttokens                         2.0.4
async-generator                   1.10
async-timeout                     3.0.1
attrdict                          2.0.1
attrs                             20.2.0
Babel                             2.8.0
backcall                          0.2.0
backoff                           1.11.1
backports.functools-lru-cache     1.6.1
base58                            2.1.0
beautifulsoup4                    4.9.3
bibtexparser                      1.2.0
binaryornot                       0.4.4
black                             21.4b2
bleach                            3.2.1
blinker                           1.4
bng-latlon                        1.0.3
bokeh                             2.2.3
boltons                           20.2.1
boto3                             1.16.30
botocore                          1.19.30
bqplot                            0.12.29
branca                            0.3.1
Brotli                            1.0.9
brotlipy                          0.7.0
bump2version                      1.0.1
cachetools                        4.1.1
cairocffi                         1.2.0
CairoSVG                          2.5.0
Cartopy                           0.18.0
certifi                           2021.10.8
cffi                              1.14.3
cftime                            1.3.0
chardet                           3.0.4
charset-normalizer                2.0.9
click                             7.1.2
click-plugins                     1.1.1
click-spinner                     0.1.10
cligj                             0.7.0
codespell                         2.1.0
cogeo-mosaic                      3.0.0a18
colorama                          0.4.4
colorlog                          4.4.0
colour                            0.1.5
commonmark                        0.9.1
conda                             4.9.1
conda-build                       3.20.5
conda-package-handling            1.7.2
cookiecutter                      1.7.3
coverage                          5.3
cryptography                      3.2.1
cssselect2                        0.4.1
cycler                            0.10.0
czml3                             0.6.0
dacite                            1.5.1
dash                              2.0.0
dash-bootstrap-components         1.0.2
dash-core-components              2.0.0
dash-html-components              2.0.0
dash-renderer                     1.9.1
dash-table                        5.0.0
datacommons                       1.4.3
datacommons-pandas                0.0.3
datapane                          0.13.1
decorator                         4.4.2
defusedxml                        0.6.0
descartes                         1.1.0
dimcli                            0.9.5
distlib                           0.3.1
docopt                            0.6.2
docutils                          0.16
dominate                          2.6.0
earthengine-api                   0.1.258
eemont                            0.2.5
entrypoints                       0.3
et-xmlfile                        1.1.0
executing                         0.5.4
face                              20.1.1
fake-useragent                    0.1.11
ffmpeg-python                     0.2.0
filelock                          3.0.12
Fiona                             1.8.18
flake8                            3.8.4
Flask                             2.0.2
Flask-Caching                     1.10.1
Flask-Compress                    1.10.1
flask-restx                       0.5.1
flask-tileserver                  0.0.6
flit-core                         2.3.0
folium                            0.12.1.post1
free-proxy                        1.0.2
furl                              2.1.0
future                            0.18.2
GDAL                              3.2.1
geeadd                            0.5.5
geemap                            0.9.4             
geocoder                          1.38.1
geodemo                           0.0.6              
geographiclib                     1.52
geojson                           2.5.0
geopandas                         0.8.1
geopy                             2.2.0
gitdb                             4.0.5
GitPython                         3.1.11
glob2                             0.7
glom                              20.11.0
google-api-core                   1.23.0
google-api-python-client          1.12.5
google-auth                       1.23.0
google-auth-httplib2              0.0.4
google-auth-oauthlib              0.4.6
google-cloud-core                 1.4.3
google-cloud-storage              1.32.0
google-crc32c                     1.0.0
google-resumable-media            1.1.0
googleapis-common-protos          1.52.0
googledrivedownloader             0.4
greenlet                          1.1.0
grip                              4.5.2
grpcio                            1.33.2
gspread                           5.0.0
gspread-dataframe                 3.2.2
gunicorn                          20.1.0
here-map-widget-for-jupyter       1.1.1
html5lib                          1.1
httplib2                          0.18.1
httplib2shim                      0.0.3
icecream                          2.1.0
idna                              2.10
imageio                           2.9.0
imagesize                         1.2.0
importlib-metadata                2.0.0
importlib-resources               5.1.2
iniconfig                         1.1.1
ipyevents                         0.8.1
ipyfilechooser                    0.6.0
ipykernel                         5.5.5
ipyleaflet                        0.15.0
ipynb-py-convert                  0.4.6
ipysheet                          0.5.0
ipyspin                           0.1.2
ipython                           7.24.1
ipython-genutils                  0.2.0
ipytree                           0.1.8
ipywidgets                        7.6.3
isort                             5.6.4
itsdangerous                      2.0.1
jedi                              0.17.2
jeepney                           0.4.3
Jinja2                            3.0.3
jinja2-time                       0.2.0
jmespath                          0.10.0
joblib                            0.17.0
json5                             0.9.5
jsonschema                        3.2.0
jupyter-client                    6.1.7
jupyter-contrib-core              0.3.3
jupyter-contrib-nbextensions      0.5.1
jupyter-core                      4.6.3
jupyter-highlight-selected-word   0.2.0
jupyter-latex-envs                1.4.6
jupyter-nbextensions-configurator 0.4.1
jupyter-packaging                 0.7.9
jupyter-server                    1.11.0
jupyterlab                        3.1.13
jupyterlab-pygments               0.1.2
jupyterlab-server                 2.8.2
jupyterlab-widgets                1.0.0
jupytext                          1.11.2
kaleido                           0.2.1
keplergl                          0.3.2
keyring                           21.4.0
kiwisolver                        1.3.1
large-image                       1.8.7
large-image-source-gdal           1.8.7
lazy-object-proxy                 1.4.3
leafmap                           0.6.0              
libarchive-c                      2.9
livereload                        2.6.3
localtileserver                   0.3.13
logzero                           1.6.2
lunr                              0.5.8
lxml                              4.6.1
mamba                             0.7.8
Markdown                          3.3.3
markdown-it-py                    1.0.0
MarkupSafe                        2.0.1
matplotlib                        3.3.2
matplotlib-inline                 0.1.2
mccabe                            0.6.1
mdit-py-plugins                   0.2.8
mercantile                        1.1.6
micawber                          0.5.3
mistune                           0.8.4
mkdocs                            1.1.2
mkdocs-git-revision-date-plugin   0.3.1
mkdocs-jupyter                    0.17.3
mkdocs-material                   6.1.2
mkdocs-material-extensions        1.0.1
mkdocs-pdf-export-plugin          0.5.8
mkdocstrings                      0.13.6
monotonic                         1.6
mss                               6.1.0
multidict                         4.7.6
munch                             2.5.0
mypy-extensions                   0.4.3
nbclassic                         0.3.2
nbclient                          0.5.1
nbconvert                         6.0.7
nbformat                          5.0.8
nest-asyncio                      1.5.4
netCDF4                           1.5.5
networkx                          2.5.1
nltk                              3.5
notebook                          6.4.6
numexpr                           2.7.1
numpy                             1.20.1
oauth2client                      4.1.3
oauthlib                          3.1.1
olefile                           0.46
opencv-python                     4.4.0.46
openpyxl                          3.0.9
orcid                             1.0.3
orderedmultidict                  1.0.1
osmnx                             1.1.1
OWSLib                            0.21.0
packaging                         20.4
palettable                        3.3.0
pandas                            1.1.4
pandocfilters                     1.4.2
parso                             0.7.1
path-and-address                  2.0.1
pathspec                          0.8.1
pathtools                         0.1.2
pexpect                           4.8.0
pickleshare                       0.7.5
Pillow                            8.0.1
pip                               20.2.4
pkginfo                           1.6.1
plotly                            5.5.0
pluggy                            0.13.1
posthog                           1.4.2
poyo                              0.5.0
prometheus-client                 0.8.0
prompt-toolkit                    3.0.8
protobuf                          3.13.0
pscript                           0.7.5
psutil                            5.7.2
psycopg2                          2.8.6
ptvsd                             4.3.2
ptyprocess                        0.6.0
py                                1.9.0
pyarrow                           3.0.0
pyasn1                            0.4.8
pyasn1-modules                    0.2.8
pycodestyle                       2.6.0
pycosat                           0.6.3
pycparser                         2.20
PyCRS                             1.0.2
pydantic                          1.7.3
pydeck                            0.7.0
pydeck-earthengine-layers         1.2.1
pyflakes                          2.2.0
pygeos                            0.9
Pygments                          2.7.2
pygount                           1.2.4
pylint                            2.6.0
pymdown-extensions                8.0.1
Pympler                           0.9
pyOpenSSL                         19.1.0
pyparsing                         2.4.7
Pyphen                            0.10.0
pyproj                            3.0.1
pyrsistent                        0.17.3
pyshp                             2.1.3
PySocks                           1.7.1
pystac                            1.2.0
pystac-client                     0.3.1
pytest                            6.2.4
pytest-cov                        2.12.1
pytest-tornasync                  0.6.0.post2
python-box                        5.3.0
python-dateutil                   2.8.1
python-dotenv                     0.15.0
python-slugify                    4.0.1
pytkdocs                          0.9.0
pytoml                            0.1.21
pytz                              2020.4
PyYAML                            6.0
pyzmq                             19.0.2
rasterio                          1.2.2
ratelim                           0.1.6
readme-renderer                   28.0
recommonmark                      0.7.1
regex                             2020.11.13
requests                          2.26.0
requests-oauthlib                 1.3.0
requests-toolbelt                 0.9.1
requests-unixsocket               0.2.0
retrying                          1.3.3
rfc3986                           1.4.0
rio-cogeo                         2.0.1
rio-mucho                         1.0.0
rio-tiler                         1.4.0
rio-toa                           0.3.0
rioxarray                         0.1.1
rope                              0.18.0
rsa                               4.6
Rtree                             0.9.4
ruamel-yaml-conda                 0.15.80
ruamel.yaml                       0.16.12
ruamel.yaml.clib                  0.2.2
s3transfer                        0.3.3
sankee                            0.0.5
scholarly                         1.0.3
scholarpy                         0.0.1              
scikit-learn                      0.23.2
scipy                             1.5.3
scooby                            0.5.9
SecretStorage                     3.1.2
selenium                          3.141.0
Send2Trash                        1.8.0
setuptools                        50.3.0.post20201103
Shapely                           1.7.1
simplejson                        3.17.2
six                               1.15.0
smmap                             3.0.4
sniffio                           1.2.0
snowballstemmer                   2.0.0
snuggs                            1.4.7
soupsieve                         2.0.1
Sphinx                            3.3.0
sphinx-rtd-theme                  0.5.1
sphinxcontrib-applehelp           1.0.2
sphinxcontrib-devhelp             1.0.2
sphinxcontrib-htmlhelp            1.0.3
sphinxcontrib-jsmath              1.0.1
sphinxcontrib-qthelp              1.0.3
sphinxcontrib-serializinghtml     1.1.4
SQLAlchemy                        1.4.17
stem                              1.8.0
streamlit                         1.3.0
streamlit-bokeh-events            0.1.2
streamlit-folium                  0.4.0
streamlit-keplergl                0.1.0
stringcase                        1.2.0
supermercado                      0.2.0
tabulate                          0.8.7
tenacity                          8.0.1
terminado                         0.9.1
testpath                          0.4.4
text-unidecode                    1.3
threadpoolctl                     2.1.0
tifffile                          2021.8.30
tinycss2                          1.1.0
toml                              0.10.2
toolz                             0.11.2
tornado                           6.1
tox                               3.20.1
tqdm                              4.51.0
traitlets                         4.3.3
traittypes                        0.2.1
tuna                              0.5.9
twine                             3.2.0
typed-ast                         1.4.1
typing-extensions                 3.7.4.3
tzlocal                           2.1
uritemplate                       3.0.1
urllib3                           1.25.11
validators                        0.18.1
vega-datasets                     0.9.0
virtualenv                        20.1.0
voila                             0.2.16             
w3lib                             1.22.0
watchdog                          0.10.3
wcwidth                           0.2.5
WeasyPrint                        52.1
webencodings                      0.5.1
websocket-client                  1.2.1
Werkzeug                          2.0.2
wheel                             0.35.1
whitebox                          2.0.1             
whiteboxgui                       0.6.0
widgetsnbextension                3.5.1
wincertstore                      0.2
wrapt                             1.12.1
xarray                            0.16.1
xarray-leaflet                    0.1.13
xlrd                              2.0.1
xyzservices                       2021.9.1
yarl                              1.5.1
zipp                              3.4.0

@banesullivan
Copy link
Owner

I think the issue is that the change I introduced requires traitlets > v5. I'll see how I can fix this to be compatible with traitlets v4

@banesullivan
Copy link
Owner

Fix is here: ipython/traitlets#626 (comment)

@giswqs
Copy link
Author

giswqs commented Dec 30, 2021

I just upgraded traitlets to v5.1.1, and the problem is solved. The traitlets package in my env was probably installed years ago. I have not used it directly.

@giswqs giswqs closed this as completed Dec 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants