ustroetz / python-osrm

A Python wrapper around the OSRM API
MIT License
133 stars 55 forks source link

ModuleNotFoundError: No module named 'osrm' #29

Closed alex6H closed 5 years ago

alex6H commented 5 years ago

Hello,

I'm new in GIS project and Python. I'm facing an issue with OSRM-python. I work on a VM with Linux (Ubuntu 18). I installed python-OSRM (with some trouble, i had to update/install a lot of lib but now it's installed). I also have an OSRM server who run on http://localhost:5000 on this VM without problem.

Now i'm on Spyder trying to import osrm and the response is ModuleNotFoundError: No module named 'osrm'. Do i have to do something else between install and import osrm ?

Tell me if you need more information. What am i missing?

Thanks

zifeo commented 5 years ago

How did you install python-osrm? Do you have multiple python version installed?

alex6H commented 5 years ago

I have Python 3.7.1 I run sudo pip install osrm. I had several error with GDAL so i search the web and install those library to fix the problem

sudo apt-get install gdal-bin sudo apt-get install python3-gdal sudo apt-get install python3-numpy

zifeo commented 5 years ago

Not sure about your environments, but it is likely you have multiple version of python (2, 3, system's ones or even virtual ones). Try to install osrm withpip3 for python3 (depends on your system) and without sudo (which should be avoided). Even try to install other modules and use python freeze or python3 freeze to debug.

alex6H commented 5 years ago

I found my error. I had to : apt-get install python-tk create virtualenv -p python2.7 py2.7 Activate the virtual environment source py2.7/bin/activate and pip install osrm

thanks for your help!