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

error trying to start tileserver - ImportError: cannot import name on_invalid_geometry_make_valid #29

Closed
songololo opened this issue Jul 8, 2016 · 6 comments

Comments

@songololo
Copy link

songololo commented Jul 8, 2016

I am getting this error when attempting to start tilserver:

I get this when using git tags 0.5.0, 0.5.1, 0.6.1 and on Ubuntu 14.04 and 16.04

Traceback (most recent call last):
  File "/tileserver/tileserver/__init__.py", line 5, in <module>
    from tilequeue.command import make_queue
  File "/usr/local/lib/python2.7/dist-packages/tilequeue/command.py", line 9, in <module>
    from tilequeue.format import lookup_format_by_extension
  File "/usr/local/lib/python2.7/dist-packages/tilequeue/format/__init__.py", line 3, in <module>
    from tilequeue.format.mvt import encode as mvt_encode
  File "/usr/local/lib/python2.7/dist-packages/tilequeue/format/mvt.py", line 1, in <module>
    from mapbox_vector_tile.encoder import on_invalid_geometry_make_valid
ImportError: cannot import name on_invalid_geometry_make_valid

Is this a circular dependency of some sort?

Thanks.

@rmarianski
Copy link
Member

Looks like it's expecting a new version of mapbox-vector-tile. Can you try using mapbox-vector-tile 0.3.0?

@songololo
Copy link
Author

I'm explicitly installing map box vector tile via pip, which uses version 0.3.0, and still seem to be getting the error.

Here are my build steps:

sudo apt-get update \
    && apt-get install -y git build-essential autoconf libtool pig-config \
    python-dev python-virtualenv libgeos-dev libpq-dev python-pip python-pil \
    libmapnik3.0 libmapnik-dev mapnik-utils python-mapnik

# avoids an errors when running requirements.txt
pip install pip --upgrade
pip install python-dateutil
pip install mapbox-vector-tile

git clone https://github.com/tilezen/tileserver.git
cd /tileserver
git checkout tags/v0.6.1
pip install -U -r requirements.txt
python setup.py develop

@songololo
Copy link
Author

songololo commented Jul 8, 2016

It seems that setup.py installs mapbox-vector-tile v0.0.11.

If I upgrade mapbox-vector-tile after running setup.py then it upgrades the following:

Collecting mapbox-vector-tile
  Downloading mapbox-vector-tile-0.3.0.tar.gz
Requirement already up-to-date: setuptools in /usr/local/lib/python2.7/dist-packages (from mapbox-vector-tile)
Collecting protobuf (from mapbox-vector-tile)
  Downloading protobuf-2.6.1.tar.gz (188kB)
Collecting shapely (from mapbox-vector-tile)
  Downloading Shapely-1.5.16.tar.gz (180kB)
Collecting future (from mapbox-vector-tile)
  Downloading future-0.15.2.tar.gz (1.6MB)
Building wheels for collected packages: mapbox-vector-tile, protobuf, shapely, future
  Running setup.py bdist_wheel for mapbox-vector-tile: started
  Running setup.py bdist_wheel for mapbox-vector-tile: finished with status 'done'
  Stored in directory: /root/.cache/pip/wheels/1b/34/56/288168c0f92ca9eb2945495ea57227963d358f08980bd6714c
  Running setup.py bdist_wheel for protobuf: started
  Running setup.py bdist_wheel for protobuf: finished with status 'done'
  Stored in directory: /root/.cache/pip/wheels/c9/97/49/1bf6b7b58d0adec650bcb625b6656877437d1f7d18c32e88ee
  Running setup.py bdist_wheel for shapely: started
  Running setup.py bdist_wheel for shapely: finished with status 'done'
  Stored in directory: /root/.cache/pip/wheels/c8/d4/e8/59d227c699be1c99199bff376d98b363c0099cd43697b0d644
  Running setup.py bdist_wheel for future: started
  Running setup.py bdist_wheel for future: finished with status 'done'
  Stored in directory: /root/.cache/pip/wheels/11/c5/d2/ad287de27d0f0d646f119dcffb921f4e63df128f28ab0a1bda
Successfully built mapbox-vector-tile protobuf shapely future
Installing collected packages: protobuf, shapely, future, mapbox-vector-tile
  Found existing installation: protobuf 2.6.0
    Uninstalling protobuf-2.6.0:
      Successfully uninstalled protobuf-2.6.0
  Found existing installation: Shapely 1.4.3
    Uninstalling Shapely-1.4.3:
      Successfully uninstalled Shapely-1.4.3
  Found existing installation: mapbox-vector-tile 0.0.11
    Uninstalling mapbox-vector-tile-0.0.11:
      Successfully uninstalled mapbox-vector-tile-0.0.11
Successfully installed future-0.15.2 mapbox-vector-tile-0.3.0 protobuf-2.6.1 shapely-1.5.16

However, the error still occurs.

@rmarianski
Copy link
Member

Sorry, I was too hasty in my response. Seems like that function doesn't actually exist in that tag. Can you try mapbox-vector-tile master?

If that works for you and you'd prefer to point to a tag, I can push out what's currently on master to a new 0.4.0 release.

@songololo
Copy link
Author

Thanks, what ended up working in the end was cloning and running setup.py on the master branch for each of these (in this order)

  1. tilserver,
  2. mapbox-vector-tile,
  3. tilequeue

@rmarianski
Copy link
Member

Great! Glad to hear it works for you and sorry for the confusion. Let us know if you want us to release a new tag.

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

No branches or pull requests

2 participants