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

ModuleNotFoundError: No module named 'polyline.codec' #59

Open
RnoldR opened this issue Sep 25, 2023 · 4 comments
Open

ModuleNotFoundError: No module named 'polyline.codec' #59

RnoldR opened this issue Sep 25, 2023 · 4 comments

Comments

@RnoldR
Copy link

RnoldR commented Sep 25, 2023

I try to install osrm on Ubuntu 22.04. Installed the dependencies as listed in the README:

GDAL==3.4.3
geopandas==0.14.0
numpy==1.26.0
osrm==0.11.3
pandas==2.1.1
polyline==2.0.0

Apart from that I installed gdal-bin and libgdal-dev using apt install. When I import osrm I get:

$ python3
Python 3.10.12 (main, Jun 11 2023, 05:26:28) [GCC 11.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import osrm
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/arnold/.local/lib/python3.10/site-packages/osrm/__init__.py", line 53, in <module>
    from .core import match, simple_route, nearest, table, trip, _chain
  File "/home/arnold/.local/lib/python3.10/site-packages/osrm/core.py", line 3, in <module>
    from polyline.codec import PolylineCodec
ModuleNotFoundError: No module named 'polyline.codec'

I could hardly find a suggestion on the net, except one remark that one should try to pip install polyline-decoder. That didn't help.

Does anyone have a suggestion? Thank you in advance.

@francisvale
Copy link

I believe this package is too old, most of the dependencies have changed. But to fix this issue go to the osrm folder package it should be something like this: C:\Users\admin\AppData\Local\Programs\Python\Python310\Lib\site-packages\osrm. Go to core.py > then delete the import of polyline.codec just a simple 'import polyline' will do, change the 'PolylineCodec().decode' with 'polyline.decode'.

you can see the that the decoding in polyline package here: https://github.com/frederickjansen/polyline

@RnoldR
Copy link
Author

RnoldR commented Oct 2, 2023

@francisvale Thanks! That worked but i now have the error: ImportError: cannot import name 'griddata' from 'matplotlib.mlab' (/usr/lib/python3/dist-packages/matplotlib/mlab.py). I followed the instructions I found in #33 but that did not help. Any suggestion on how to solve that.

As to the old version: I did the update as suggested in #33 and my current version is 0.11.3. Is this the latest version?

@Shawn94
Copy link

Shawn94 commented Nov 26, 2023

@francisvale Thanks! That worked but i now have the error: ImportError: cannot import name 'griddata' from 'matplotlib.mlab' (/usr/lib/python3/dist-packages/matplotlib/mlab.py). I followed the instructions I found in #33 but that did not help. Any suggestion on how to solve that.

As to the old version: I did the update as suggested in #33 and my current version is 0.11.3. Is this the latest version?

Did you find solutions to this issue? I`m facing the same error...

@jordanpaeth
Copy link

for me the solution to the 'griddata' was same as

#36 (comment)

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

4 participants