terracotta-dash-example icon indicating copy to clipboard operation
terracotta-dash-example copied to clipboard

cannot run python3 tc_server.py

Open sukhjitsehra opened this issue 3 years ago • 2 comments

It thows Import error cannot import name 'convert_exceptions'

when I run python3 tc_server.py

 python3 tc_server.py 
Traceback (most recent call last):
  File "tc_server.py", line 3, in <module>
    from terracotta_toolbelt.extensions import point
  File "/Volumes/data/SystemSoftwares/anaconda3/envs/terracotta_3.6/lib/python3.6/site-packages/terracotta_toolbelt/extensions/__init__.py", line 1, in <module>
    import terracotta_toolbelt.extensions.point
  File "/Volumes/data/SystemSoftwares/anaconda3/envs/terracotta_3.6/lib/python3.6/site-packages/terracotta_toolbelt/extensions/point.py", line 7, in <module>
    from terracotta.server.flask_api import convert_exceptions
ImportError: cannot import name 'convert_exceptions'

Any suggestions?

sukhjitsehra avatar Feb 04 '22 15:02 sukhjitsehra

I got the same error, running python3.8

wle0001 avatar Feb 23 '22 19:02 wle0001

import rasterio
from flask import jsonify
from rasterio import warp

from terracotta import get_settings, get_driver
from terracotta.exceptions import InvalidArgumentsError
#from terracotta.server.flask_api import convert_exceptions


def register(server):
    @server.route("/point/<path:keys>/<string:lat>/<string:lng>", methods=["GET"])
    #@convert_exceptions

I have only commented out the part where the "convert_exceptions" are imported. Then the server starts.

zeppehpt1 avatar Oct 12 '22 13:10 zeppehpt1