-
Notifications
You must be signed in to change notification settings - Fork 7
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
AttributeError: module 'osrm' has no attribute 'Client' #7
Comments
I am getting the exact same error. My environment is Python 3.8.5 and Ubuntu 20.04.1 LTS. Is there any idea on this? |
AttributeError: module 'osrm' has no attribute 'table' |
Could you please elaborate more? I successfully use osrm.table. First, you have to run the osrm server. |
osrm_result = osrm.table(locations, |
I see. To my understanding though, it does not seem to work. dir(osrm) If I run your command, I get: In [22]: dist_od = osrm.table(locations, output='pandas', annotations='distance') In [23]: dist_od So maybe try this [1] instead. |
But I'm not able to install osrm=0.11.3. I tried gdal and Fiona packages
which was early errors. Then I was able to run pip install osrm command on
terminal and it is getting installed but when I check the same on python
interpreter it says package to be installed and it gives me error when
trying to install it.
Any suggestions is much appreciated
…On Tue, 28 Dec, 2021, 6:08 pm Babis Babalis, ***@***.***> wrote:
I see. To my understanding though, it does not seem to work.
Maybe you could try to go with this [1]. I am able to run the exact
command you put above and get the results.
In this, the "table" is absolutely there.
dir(osrm)
Out[20]:
['AccessIsochrone',
'DefaultRequestConfig',
'Point',
'RequestConfig',
'*builtins*',
'*cached*',
'*doc*',
'*file*',
'*loader*',
'*name*',
'*package*',
'*path*',
'*spec*',
'*version*',
'_chain',
'base64',
'core',
'extra',
'match',
'namedtuple',
'nearest',
'simple_route',
'sys',
'table',
'trip']
If I run your command, I get:
locations = [[25.7175216,35.190589],[25.8753275,40.845692]]
In [22]: dist_od = osrm.table(locations, output='pandas',
annotations='distance')
In [23]: dist_od
Out[23]:
( 0 1
0 0.0 1195886.8
1 1197131.4 0.0,
[[25.7182, 35.191183], [25.875501, 40.845421]],
None)
So maybe try this [1] instead.
[1] https://github.com/ustroetz/python-osrm
—
Reply to this email directly, view it on GitHub
<#7 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AW752OZCH6ZOMFYN6VHBLEDUTGVVLANCNFSM4LF4BEWQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you commented.Message ID:
***@***.***>
|
@Abhi8162 Maybe you're mixing up the packages osrm-py and python-osrm (which is comprehensible). Here, we're in the repository for osrm-py, but your problem seems related to python-osrm. Try |
I have installed osrm-py in my jupyter successfully. Yet, when I run the following test code it throws "AttributeError: module 'osrm' has no attribute 'Client'
import osrm
client = osrm.Client(host='http://localhost:5000')
response = client.route(
coordinates=[[-74.0056, 40.6197], [-74.0034, 40.6333]],
overview=osrm.overview.full)
print(response)
My environment:
Operating System: CentOS 7, 64bit
Python 3.5.6 :: Anaconda 4.1.1 (64-bit)
The text was updated successfully, but these errors were encountered: