You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After following the instructions for installation of OSMnx (including explicitly installing spatialindex ) with
brew install spatialindex
pip install osmnx
running the very first basic example of
import osmnx as ox
G = ox.graph_from_place('Manhattan Island, New York City, New York, USA', network_type='drive')
ox.plot_graph(ox.project_graph(G))
in the project's readme, I get
Traceback (most recent call last):
File "/Users/Rax/Documents/Projects/Coding/Python/maps/test.py", line 23, in <module>
G = ox.graph_from_place('Manhattan Island, New York City, New York, USA', network_type='drive')
File "/usr/local/lib/python2.7/site-packages/osmnx/core.py", line 1850, in graph_from_place
raise TypeError('query must be a string or a list of query strings')
TypeError: query must be a string or a list of query strings
What operating system, architecture, Python version, and OSMnx version are you using?
OSMnx is compatible with Python 2 and 3, so you don't need to import from the future package to use it. If you use Python 2 and import unicode_literals from future, all of your strings will be of type unicode instead. As you can see in the documentation, graph_from_place expects the query to be of type string, not of type unicode.
Problem description
After following the instructions for installation of OSMnx (including explicitly installing
spatialindex
) withrunning the very first basic example of
in the project's readme, I get
What operating system, architecture, Python version, and OSMnx version are you using?
macOS: 10.13.6 (17G65)
Python: 2.7.15
OSMnx: 0.8.1
Possible cause
I routinely begin my Python 2.7 code with
and removing
unicode_literals
fixes the problem.The text was updated successfully, but these errors were encountered: