gboeing / osmnx

OSMnx is a Python package to easily download, model, analyze, and visualize street networks and other geospatial features from OpenStreetMap.
https://osmnx.readthedocs.io
MIT License
4.81k stars 821 forks source link

TypeError: unhashable type: 'dict' #372

Closed liquidgenius closed 4 years ago

liquidgenius commented 4 years ago

Problem description

created a poetry project used pyenv to set the base interpreter as Python 3.8.0 poetry shell poetry add networkx osmnx IPython ipyleaflet created maps.py with the following content and executed:

import networkx as nx
import osmnx as ox
from IPython.display import IFrame
ox.config(log_console=True, use_cache=True)

# download the street network for Piedmont, CA
#{‘walk’, ‘bike’, ‘drive’, ‘drive_service’, ‘all’, ‘all_private’}
G = ox.graph_from_place('Piedmont, California, USA', network_type='drive', infrastructure='way["highway"]', simplify=False)

received the following log and error:

/Users/liquidgenius/Library/Caches/pypoetry/virtualenvs/discovery-osmnx-maps-92MSC4tJ-py3.8/bin/python /Users/liquidgenius/Projects/discovery-osmnx-maps/src/maps.py
Configured osmnx
Retrieved response from cache file "cache/7a10ef7f51a32868ea1208e6d6162cd1.json" for URL "https://nominatim.openstreetmap.org/search?format=json&limit=1&dedupe=0&polygon_geojson=1&q=Piedmont%2C+California%2C+USA"
Created GeoDataFrame with 1 row for query "Piedmont, California, USA"
Constructed place geometry polygon(s) to query API
Projected the GeoDataFrame "geometry to project" to UTM-10 in 0.04 seconds
Projected the GeoDataFrame "geometry to project" to default_crs in 0.01 seconds
Requesting network data within polygon from API in 1 request(s)
Retrieved response from cache file "cache/80e4ddd06d01fa3cf512ef17fdefa770.json" for URL "http://overpass-api.de/api/interpreter?data=%5Bout%3Ajson%5D%5Btimeout%3A180%5D%3B%28way%5B%22highway%22%5D%5B%22area%22%21~%22yes%22%5D%5B%22highway%22%21~%22cycleway%7Cfootway%7Cpath%7Cpedestrian%7Csteps%7Ctrack%7Ccorridor%7Celevator%7Cescalator%7Cproposed%7Cconstruction%7Cbridleway%7Cabandoned%7Cplatform%7Craceway%7Cservice%22%5D%5B%22motor_vehicle%22%21~%22no%22%5D%5B%22motorcar%22%21~%22no%22%5D%5B%22access%22%21~%22private%22%5D%5B%22service%22%21~%22parking%7Cparking_aisle%7Cdriveway%7Cprivate%7Cemergency_access%22%5D%28poly%3A%2237.823649+-122.249374+37.823390+-122.248859+37.823300+-122.248953+37.822939+-122.249336+37.822010+-122.248041+37.821599+-122.247468+37.821552+-122.247414+37.821424+-122.247267+37.820899+-122.246667+37.820725+-122.246468+37.820602+-122.246395+37.820499+-122.246322+37.820215+-122.246123+37.820079+-122.245992+37.819942+-122.245841+37.819700+-122.245554+37.819462+-122.245309+37.819297+-122.245125+37.819218+-122.245030+37.819172+-122.244801+37.819074+-122.244287+37.819027+-122.244191+37.818972+-122.244022+37.818807+-122.243518+37.818753+-122.243351+37.818722+-122.243173+37.818712+-122.243200+37.818592+-122.242747+37.818552+-122.242596+37.818460+-122.242198+37.818187+-122.241007+37.818096+-122.240610+37.818045+-122.240350+37.817892+-122.239570+37.817841+-122.239310+37.817756+-122.238966+37.817503+-122.237934+37.817419+-122.237591+37.817399+-122.237361+37.817341+-122.236673+37.817322+-122.236444+37.817277+-122.236208+37.817143+-122.235500+37.817099+-122.235265+37.817064+-122.235139+37.816961+-122.234761+37.816927+-122.234635+37.816850+-122.234363+37.816777+-122.234123+37.816621+-122.233549+37.816545+-122.233278+37.816476+-122.233067+37.816270+-122.232438+37.816202+-122.232228+37.816054+-122.231504+37.815613+-122.229332+37.815530+-122.228951+37.815466+-122.228609+37.815313+-122.227934+37.814855+-122.225912+37.814703+-122.225238+37.814660+-122.225084+37.814632+-122.224992+37.814420+-122.224256+37.814350+-122.224011+37.814286+-122.223735+37.814097+-122.222910+37.814034+-122.222635+37.813986+-122.222336+37.813845+-122.221439+37.813798+-122.221141+37.813748+-122.221006+37.813744+-122.220944+37.813583+-122.220355+37.813530+-122.220159+37.813430+-122.219694+37.813421+-122.219670+37.813110+-122.218295+37.813096+-122.218206+37.812988+-122.217718+37.812955+-122.217552+37.812945+-122.217478+37.812898+-122.217196+37.812818+-122.216760+37.812776+-122.216521+37.812677+-122.216250+37.812646+-122.216164+37.812543+-122.215945+37.812370+-122.215445+37.812276+-122.215174+37.812347+-122.215134+37.812381+-122.215111+37.812520+-122.215021+37.812554+-122.214993+37.812668+-122.214882+37.812695+-122.214857+37.812749+-122.214791+37.812892+-122.214645+37.812934+-122.214590+37.813024+-122.214476+37.813107+-122.214354+37.813201+-122.214237+37.813336+-122.214086+37.813383+-122.214044+37.813423+-122.214015+37.813473+-122.213978+37.813499+-122.213959+37.813591+-122.213901+37.813669+-122.213863+37.813712+-122.213847+37.813822+-122.213802+37.813968+-122.213728+37.814058+-122.213673+37.814122+-122.213623+37.814636+-122.213190+37.814772+-122.213108+37.814779+-122.213104+37.814913+-122.213054+37.815060+-122.213017+37.815202+-122.212988+37.815812+-122.212910+37.816077+-122.212848+37.816227+-122.212800+37.816384+-122.212731+37.816646+-122.212596+37.816830+-122.212480+37.817040+-122.212327+37.817268+-122.212129+37.817457+-122.211929+37.817707+-122.211610+37.817981+-122.211212+37.818320+-122.210724+37.818728+-122.210148+37.818866+-122.210410+37.819280+-122.211195+37.819419+-122.211458+37.819512+-122.211627+37.819791+-122.212135+37.819885+-122.212305+37.820117+-122.212719+37.820141+-122.212732+37.820911+-122.214013+37.821168+-122.214440+37.821281+-122.214649+37.821620+-122.215278+37.821734+-122.215488+37.821861+-122.215615+37.822003+-122.215767+37.822242+-122.215999+37.822370+-122.216127+37.822425+-122.216144+37.822487+-122.216172+37.822514+-122.216185+37.822604+-122.216302+37.822671+-122.216473+37.822673+-122.216491+37.822692+-122.216617+37.822742+-122.216714+37.822845+-122.216911+37.822895+-122.217006+37.822946+-122.217104+37.823018+-122.217254+37.823067+-122.217381+37.823432+-122.218212+37.823554+-122.218489+37.823788+-122.218785+37.824006+-122.219061+37.824242+-122.219360+37.824327+-122.219466+37.825364+-122.220777+37.825817+-122.221349+37.826102+-122.221499+37.826276+-122.221587+37.826330+-122.221625+37.826960+-122.221949+37.827246+-122.222100+37.827319+-122.222151+37.827424+-122.222260+37.827539+-122.222307+37.827613+-122.222359+37.827884+-122.222591+37.827972+-122.222666+37.828059+-122.222741+37.828126+-122.222798+37.829206+-122.223721+37.829695+-122.224083+37.830239+-122.224486+37.830440+-122.224594+37.831046+-122.224919+37.831249+-122.225028+37.831330+-122.225178+37.831573+-122.225631+37.831605+-122.225690+37.831655+-122.225782+37.831703+-122.225871+37.831847+-122.226139+37.831895+-122.226229+37.831929+-122.226280+37.831977+-122.226392+37.831982+-122.226408+37.832000+-122.226460+37.832029+-122.226752+37.832052+-122.226820+37.832079+-122.226873+37.832109+-122.226919+37.832148+-122.226962+37.832155+-122.226966+37.832247+-122.227016+37.832335+-122.227054+37.832473+-122.227258+37.832887+-122.227873+37.833026+-122.228079+37.832642+-122.229317+37.832363+-122.230218+37.832256+-122.230566+37.831726+-122.232279+37.831582+-122.233055+37.831348+-122.234331+37.831302+-122.234580+37.831163+-122.235330+37.831118+-122.235581+37.831072+-122.235855+37.831038+-122.236059+37.830846+-122.236656+37.830761+-122.236921+37.830786+-122.236966+37.830823+-122.237048+37.830842+-122.237151+37.830836+-122.237251+37.830817+-122.237299+37.830807+-122.237327+37.830696+-122.237552+37.830656+-122.237723+37.830623+-122.237892+37.830596+-122.238227+37.830581+-122.238456+37.830572+-122.238596+37.830537+-122.238852+37.830503+-122.239064+37.830479+-122.239668+37.830478+-122.239748+37.830466+-122.240781+37.830458+-122.240935+37.830439+-122.241087+37.830406+-122.241229+37.830107+-122.242351+37.830094+-122.242402+37.830021+-122.242715+37.830009+-122.242825+37.830007+-122.242915+37.830012+-122.243025+37.830063+-122.243288+37.830068+-122.243293+37.830083+-122.243311+37.830088+-122.243317+37.830048+-122.243348+37.829776+-122.243557+37.828839+-122.244279+37.828657+-122.244436+37.828501+-122.244367+37.828317+-122.244260+37.828293+-122.244292+37.828205+-122.244417+37.828135+-122.244548+37.828089+-122.244638+37.827978+-122.244805+37.827648+-122.245308+37.827538+-122.245476+37.827263+-122.245907+37.827239+-122.245945+37.826496+-122.247236+37.826241+-122.247680+37.826034+-122.247748+37.825417+-122.247953+37.825211+-122.248022+37.825131+-122.248040+37.824894+-122.248098+37.824815+-122.248118+37.824632+-122.248324+37.824586+-122.248373+37.823883+-122.249123+37.823649+-122.249374%22%29%3B%3E%3B%29%3Bout%3B"
Got all network data within polygon from API in 1 request(s) and 0.01 seconds
Creating networkx graph from downloaded OSM data...
Created graph with 2,975 nodes and 5,936 edges in 0.04 seconds
Added edge lengths to graph in 0.08 seconds
Identifying all nodes that lie outside the polygon...
Created r-tree spatial index for 2,975 points in 0.11 seconds
Traceback (most recent call last):
  File "/Users/liquidgenius/Projects/discovery-osmnx-maps/src/maps.py", line 8, in <module>
    G = ox.graph_from_place('Piedmont, California, USA', network_type='drive', infrastructure='way["highway"]',
  File "/Users/liquidgenius/Library/Caches/pypoetry/virtualenvs/discovery-osmnx-maps-92MSC4tJ-py3.8/lib/python3.8/site-packages/osmnx/core.py", line 1445, in graph_from_place
    G = graph_from_polygon(polygon, network_type=network_type, simplify=simplify,
  File "/Users/liquidgenius/Library/Caches/pypoetry/virtualenvs/discovery-osmnx-maps-92MSC4tJ-py3.8/lib/python3.8/site-packages/osmnx/core.py", line 1355, in graph_from_polygon
    G = truncate_graph_polygon(G, polygon, retain_all=retain_all, truncate_by_edge=truncate_by_edge)
  File "/Users/liquidgenius/Library/Caches/pypoetry/virtualenvs/discovery-osmnx-maps-92MSC4tJ-py3.8/lib/python3.8/site-packages/osmnx/core.py", line 733, in truncate_graph_polygon
    points_within_geometry = intersect_index_quadrats(gdf_nodes, polygon, quadrat_width=quadrat_width, min_num=min_num, buffer_amount=buffer_amount)
  File "/Users/liquidgenius/Library/Caches/pypoetry/virtualenvs/discovery-osmnx-maps-92MSC4tJ-py3.8/lib/python3.8/site-packages/osmnx/core.py", line 680, in intersect_index_quadrats
    points_within_geometry = points_within_geometry.drop_duplicates(subset='node')
  File "/Users/liquidgenius/Library/Caches/pypoetry/virtualenvs/discovery-osmnx-maps-92MSC4tJ-py3.8/lib/python3.8/site-packages/pandas/core/frame.py", line 4808, in drop_duplicates
    duplicated = self.duplicated(subset, keep=keep)
  File "/Users/liquidgenius/Library/Caches/pypoetry/virtualenvs/discovery-osmnx-maps-92MSC4tJ-py3.8/lib/python3.8/site-packages/pandas/core/frame.py", line 4885, in duplicated
    labels, shape = map(list, zip(*map(f, vals)))
  File "/Users/liquidgenius/Library/Caches/pypoetry/virtualenvs/discovery-osmnx-maps-92MSC4tJ-py3.8/lib/python3.8/site-packages/pandas/core/frame.py", line 4859, in f
    labels, shape = algorithms.factorize(
  File "/Users/liquidgenius/Library/Caches/pypoetry/virtualenvs/discovery-osmnx-maps-92MSC4tJ-py3.8/lib/python3.8/site-packages/pandas/core/algorithms.py", line 629, in factorize
    codes, uniques = _factorize_array(
  File "/Users/liquidgenius/Library/Caches/pypoetry/virtualenvs/discovery-osmnx-maps-92MSC4tJ-py3.8/lib/python3.8/site-packages/pandas/core/algorithms.py", line 478, in _factorize_array
    uniques, codes = table.factorize(values, na_sentinel=na_sentinel, na_value=na_value)
  File "pandas/_libs/hashtable_class_helper.pxi", line 1806, in pandas._libs.hashtable.PyObjectHashTable.factorize
  File "pandas/_libs/hashtable_class_helper.pxi", line 1726, in pandas._libs.hashtable.PyObjectHashTable._unique
TypeError: unhashable type: 'dict'

Process finished with exit code 1

What operating system, architecture, Python version, and OSMnx version are you using?

macOS 10.14.6 Python 3.8.0 OSMnx 0.11.3

Complete list of your environment's packages and their versions

appnope            0.1.0       Disable App Nap on OS X 10.9
attrs              19.3.0      Classes Without Boilerplate
backcall           0.1.0       Specifications for callback functions passed in to an API
bleach             3.1.0       An easy safelist-based HTML-sanitizing tool.
branca             0.3.1       Generate complex HTML+JS pages with Python
certifi            2019.11.28  Python package for providing Mozilla's CA Bundle.
chardet            3.0.4       Universal encoding detector for Python 2 and 3
click              7.0         Composable command line interface toolkit
click-plugins      1.1.1       An extension module for click to enable registering CLI commands via setuptools entry-points.
cligj              0.5.0       Click params for commmand line interfaces to GeoJSON
cycler             0.10.0      Composable style cycles
decorator          4.4.1       Decorators for Humans
defusedxml         0.6.0       XML bomb protection for Python stdlib modules
descartes          1.1.0       Use geometric objects as matplotlib paths and patches
entrypoints        0.3         Discover and load entry points from installed packages.
fiona              1.8.13      Fiona reads and writes spatial data files
geopandas          0.6.2       Geographic pandas extensions
idna               2.8         Internationalized Domain Names in Applications (IDNA)
ipykernel          5.1.4       IPython Kernel for Jupyter
ipyleaflet         0.12.1      A Jupyter widget for dynamic Leaflet maps
ipython            7.11.1      IPython: Productive Interactive Computing
ipython-genutils   0.2.0       Vestigial utilities from IPython
ipywidgets         7.5.1       IPython HTML widgets for Jupyter
jedi               0.16.0      An autocompletion tool for Python that can be used for text editors.
jinja2             2.11.1      A very fast and expressive template engine.
jsonschema         3.2.0       An implementation of JSON Schema validation for Python
jupyter-client     5.3.4       Jupyter protocol implementation and client libraries
jupyter-core       4.6.1       Jupyter core package. A base package on which Jupyter projects rely.
kiwisolver         1.1.0       A fast implementation of the Cassowary constraint solver
markupsafe         1.1.1       Safely add untrusted strings to HTML/XML markup.
matplotlib         3.1.2       Python plotting package
mistune            0.8.4       The fastest markdown parser in pure Python
more-itertools     8.2.0       More routines for operating on iterables, beyond itertools
munch              2.5.0       A dot-accessible dictionary (a la JavaScript objects)
nbconvert          5.6.1       Converting Jupyter Notebooks
nbformat           5.0.4       The Jupyter Notebook format
networkx           2.4         Python package for creating and manipulating graphs and networks
notebook           6.0.3       A web-based notebook environment for interactive computing
numpy              1.18.1      NumPy is the fundamental package for array computing with Python.
osmnx              0.11.3      Retrieve, model, analyze, and visualize OpenStreetMap street networks and other spatial data
packaging          20.1        Core utilities for Python packages
pandas             1.0.0       Powerful data structures for data analysis, time series, and statistics
pandocfilters      1.4.2       Utilities for writing pandoc filters in python
parso              0.6.0       A Python Parser
pexpect            4.8.0       Pexpect allows easy control of interactive console applications.
pickleshare        0.7.5       Tiny 'shelve'-like database with concurrency support
pluggy             0.13.1      plugin and hook calling mechanisms for python
prometheus-client  0.7.1       Python client for the Prometheus monitoring system.
prompt-toolkit     3.0.3       Library for building powerful interactive command lines in Python
ptyprocess         0.6.0       Run a subprocess in a pseudo terminal
py                 1.8.1       library with cross-python path, ini-parsing, io, code, log facilities
pygments           2.5.2       Pygments is a syntax highlighting package written in Python.
pyparsing          2.4.6       Python parsing module
pyproj             2.4.2.post1 Python interface to PROJ (cartographic projections and coordinate transformations library)
pyrsistent         0.15.7      Persistent/Functional/Immutable data structures
pytest             5.3.5       pytest: simple powerful testing with Python
python-dateutil    2.8.1       Extensions to the standard Python datetime module
pytz               2019.3      World timezone definitions, modern and historical
pyzmq              18.1.1      Python bindings for 0MQ
requests           2.22.0      Python HTTP for Humans.
rtree              0.9.3       R-Tree spatial index for Python GIS
send2trash         1.5.0       Send file to trash natively under Mac OS X, Windows and Linux.
shapely            1.7.0       Geometric objects, predicates, and operations
six                1.14.0      Python 2 and 3 compatibility utilities
terminado          0.8.3       Terminals served to xterm.js using Tornado websockets
testpath           0.4.4       Test utilities for code working with files and commands
tornado            6.0.3       Tornado is a Python web framework and asynchronous networking library, originally developed at FriendFeed.
traitlets          4.3.3       Traitlets Python config system
traittypes         0.2.1       Scipy trait types
urllib3            1.25.8      HTTP library with thread-safe connection pooling, file post, and more.
wcwidth            0.1.8       Measures number of Terminal column cells of wide-character codes
webencodings       0.5.1       Character encoding aliases for legacy web content
widgetsnbextension 3.5.1       IPython HTML widgets for Jupyter
xarray             0.15.0      N-D labeled arrays and datasets in Python
liquidgenius commented 4 years ago

A reinstall of the environment again as clean Python 3.8.0 with only the osmnx module added produces the same error with the following minimized code:

Code:

import osmnx as ox
ox.config(log_console=True, use_cache=True)

# download the street network for Piedmont, CA
G = ox.graph_from_place('Piedmont, California, USA', network_type='drive') 

Error:

/Users/liquidgenius/Library/Caches/pypoetry/virtualenvs/osmnx-maps-4FpwlMfr-py3.8/bin/python /Users/liquidgenius/Projects/osmnx_maps/src/main.py
Configured osmnx
Retrieved response from cache file "cache/7a10ef7f51a32868ea1208e6d6162cd1.json" for URL "https://nominatim.openstreetmap.org/search?format=json&limit=1&dedupe=0&polygon_geojson=1&q=Piedmont%2C+California%2C+USA"
Created GeoDataFrame with 1 row for query "Piedmont, California, USA"
Constructed place geometry polygon(s) to query API
Projected the GeoDataFrame "geometry to project" to UTM-10 in 0.01 seconds
Projected the GeoDataFrame "geometry to project" to default_crs in 0.01 seconds
Projected the GeoDataFrame "geometry to project" to UTM-10 in 0.01 seconds
Projected the GeoDataFrame "geometry to project" to default_crs in 0.01 seconds
Requesting network data within polygon from API in 1 request(s)
Retrieved response from cache file "cache/2e68726eb0121fe5f6f00f39771d3830.json" for URL "http://overpass-api.de/api/interpreter?data=%5Bout%3Ajson%5D%5Btimeout%3A180%5D%3B%28way%5B%22highway%22%5D%5B%22area%22%21~%22yes%22%5D%5B%22highway%22%21~%22cycleway%7Cfootway%7Cpath%7Cpedestrian%7Csteps%7Ctrack%7Ccorridor%7Celevator%7Cescalator%7Cproposed%7Cconstruction%7Cbridleway%7Cabandoned%7Cplatform%7Craceway%7Cservice%22%5D%5B%22motor_vehicle%22%21~%22no%22%5D%5B%22motorcar%22%21~%22no%22%5D%5B%22access%22%21~%22private%22%5D%5B%22service%22%21~%22parking%7Cparking_aisle%7Cdriveway%7Cprivate%7Cemergency_access%22%5D%28poly%3A%2237.823113+-122.255010+37.823199+-122.255027+37.823651+-122.255055+37.824104+-122.255026+37.824552+-122.254940+37.824991+-122.254797+37.825417+-122.254600+37.825824+-122.254350+37.826210+-122.254049+37.826569+-122.253701+37.826799+-122.253455+37.826915+-122.253330+37.827176+-122.253244+37.827377+-122.253178+37.827800+-122.253010+37.828208+-122.252791+37.828597+-122.252523+37.828964+-122.252207+37.829303+-122.251848+37.829613+-122.251448+37.829891+-122.251012+37.830143+-122.250573+37.830803+-122.249429+37.830839+-122.249407+37.831197+-122.249128+37.831286+-122.249052+37.832123+-122.248407+37.832393+-122.248200+37.832408+-122.248188+37.832448+-122.248157+37.832806+-122.247849+37.833139+-122.247498+37.833444+-122.247109+37.833717+-122.246685+37.833957+-122.246229+37.834162+-122.245747+37.834328+-122.245241+37.834455+-122.244718+37.834542+-122.244183+37.834587+-122.243639+37.834589+-122.243372+37.834678+-122.243039+37.834731+-122.242827+37.834764+-122.242685+37.834890+-122.241972+37.834909+-122.241820+37.834955+-122.241306+37.834963+-122.241152+37.834972+-122.240864+37.834984+-122.239854+37.834988+-122.239743+37.835013+-122.239561+37.835040+-122.239289+37.835061+-122.239227+37.835189+-122.238722+37.835278+-122.238205+37.835314+-122.237839+37.835348+-122.237717+37.835448+-122.237227+37.835481+-122.237028+37.835520+-122.236796+37.835555+-122.236603+37.835691+-122.235869+37.835737+-122.235620+37.835738+-122.235611+37.835971+-122.234342+37.836041+-122.233967+37.836454+-122.232630+37.836562+-122.232282+37.836840+-122.231384+37.837223+-122.230148+37.837363+-122.229621+37.837462+-122.229079+37.837518+-122.228527+37.837531+-122.227970+37.837501+-122.227415+37.837429+-122.226866+37.837313+-122.226329+37.837157+-122.225809+37.836961+-122.225310+37.836727+-122.224838+37.836458+-122.224397+37.836321+-122.224194+37.835909+-122.223581+37.835902+-122.223571+37.835860+-122.223509+37.835655+-122.223085+37.835595+-122.222985+37.835586+-122.222968+37.835578+-122.222952+37.835434+-122.222684+37.835429+-122.222676+37.835381+-122.222587+37.835374+-122.222573+37.835322+-122.222478+37.835298+-122.222434+37.835063+-122.221995+37.835055+-122.221980+37.834974+-122.221830+37.834716+-122.221399+37.834427+-122.221000+37.834110+-122.220638+37.833766+-122.220315+37.833400+-122.220035+37.833015+-122.219801+37.832810+-122.219691+37.832272+-122.219402+37.831977+-122.219183+37.831614+-122.218915+37.830654+-122.218095+37.830647+-122.218088+37.830591+-122.218041+37.830515+-122.217976+37.830496+-122.217959+37.830412+-122.217887+37.830144+-122.217659+37.829807+-122.217396+37.829733+-122.217344+37.829631+-122.217281+37.829503+-122.217182+37.829430+-122.217131+37.828987+-122.216860+37.828701+-122.216709+37.828662+-122.216688+37.828379+-122.216543+37.827516+-122.215453+37.827432+-122.215347+37.827198+-122.215051+37.827190+-122.215041+37.827029+-122.214674+37.826870+-122.214305+37.826798+-122.214155+37.826740+-122.214040+37.826711+-122.213957+37.826644+-122.213786+37.826416+-122.213272+37.826146+-122.212791+37.825839+-122.212347+37.825749+-122.212230+37.825389+-122.211810+37.825007+-122.211454+37.825005+-122.211449+37.824892+-122.211240+37.824758+-122.211006+37.824502+-122.210581+37.823733+-122.209301+37.823648+-122.209175+37.823573+-122.209040+37.823492+-122.208894+37.823215+-122.208389+37.823146+-122.208264+37.823031+-122.208047+37.822619+-122.207266+37.822482+-122.207006+37.822225+-122.206566+37.821937+-122.206159+37.821618+-122.205789+37.821273+-122.205460+37.820904+-122.205174+37.820515+-122.204933+37.820110+-122.204741+37.819692+-122.204599+37.819265+-122.204508+37.818833+-122.204469+37.818400+-122.204482+37.817970+-122.204548+37.817547+-122.204666+37.817135+-122.204834+37.816738+-122.205051+37.816359+-122.205316+37.816002+-122.205625+37.815670+-122.205975+37.815367+-122.206365+37.814959+-122.206941+37.814930+-122.206982+37.814675+-122.207349+37.814481+-122.207381+37.814339+-122.207410+37.814177+-122.207447+37.814030+-122.207484+37.813634+-122.207607+37.813500+-122.207657+37.812918+-122.207931+37.812911+-122.207935+37.812827+-122.207984+37.812691+-122.208066+37.812132+-122.208467+37.811978+-122.208597+37.811966+-122.208603+37.811575+-122.208821+37.811483+-122.208879+37.811239+-122.209045+37.811213+-122.209064+37.811191+-122.209080+37.811159+-122.209104+37.811136+-122.209120+37.810777+-122.209410+37.810730+-122.209452+37.810345+-122.209837+37.810210+-122.209988+37.810035+-122.210195+37.809941+-122.210312+37.809922+-122.210337+37.809674+-122.210537+37.809327+-122.210879+37.809009+-122.211262+37.808722+-122.211682+37.808469+-122.212135+37.808252+-122.212618+37.808073+-122.213125+37.807935+-122.213651+37.807838+-122.214192+37.807783+-122.214742+37.807771+-122.215296+37.807802+-122.215849+37.807875+-122.216396+37.807991+-122.216931+37.808147+-122.217449+37.808240+-122.217718+37.808412+-122.218216+37.808499+-122.218428+37.808535+-122.218647+37.808536+-122.218646+37.808586+-122.218943+37.808619+-122.219109+37.808647+-122.219244+37.808740+-122.219662+37.808776+-122.219850+37.809087+-122.221225+37.809106+-122.221298+37.809181+-122.221649+37.809265+-122.221991+37.809318+-122.222187+37.809322+-122.222205+37.809389+-122.222450+37.809446+-122.222678+37.809566+-122.223440+37.809569+-122.223463+37.809617+-122.223762+37.809705+-122.224211+37.809768+-122.224486+37.809957+-122.225311+37.809961+-122.225329+37.810025+-122.225605+37.810110+-122.225936+37.810180+-122.226181+37.810184+-122.226195+37.810396+-122.226930+37.810412+-122.226982+37.810520+-122.227465+37.810522+-122.227472+37.810980+-122.229494+37.811104+-122.230040+37.811143+-122.230250+37.811185+-122.230460+37.811258+-122.230791+37.811688+-122.232912+37.811690+-122.232921+37.811838+-122.233645+37.812030+-122.234375+37.812098+-122.234585+37.812105+-122.234606+37.812310+-122.235233+37.812335+-122.235308+37.812365+-122.235416+37.812513+-122.235963+37.812569+-122.236157+37.812624+-122.236335+37.812672+-122.236504+37.812695+-122.236590+37.812699+-122.236606+37.812766+-122.236853+37.812871+-122.237407+37.812918+-122.237961+37.812919+-122.237980+37.812939+-122.238210+37.813006+-122.238743+37.813113+-122.239267+37.813198+-122.239611+37.813451+-122.240643+37.813454+-122.240655+37.813499+-122.240838+37.813517+-122.240934+37.813670+-122.241713+37.813721+-122.241973+37.813767+-122.242187+37.813858+-122.242584+37.814131+-122.243775+37.814134+-122.243787+37.814226+-122.244185+37.814278+-122.244395+37.814318+-122.244546+37.814438+-122.244999+37.814453+-122.245050+37.814580+-122.245495+37.814634+-122.245662+37.814641+-122.245685+37.814797+-122.246160+37.814803+-122.246192+37.814849+-122.246421+37.814970+-122.246925+37.815128+-122.247413+37.815321+-122.247881+37.815547+-122.248324+37.815805+-122.248739+37.816092+-122.249121+37.816171+-122.249217+37.816316+-122.249386+37.816481+-122.249570+37.816608+-122.249705+37.816727+-122.249828+37.816858+-122.249983+37.816976+-122.250117+37.817113+-122.250268+37.817343+-122.250506+37.817479+-122.250637+37.818026+-122.251088+37.818110+-122.251147+37.818393+-122.251471+37.818403+-122.251482+37.818668+-122.251851+37.819597+-122.253146+37.819902+-122.253532+37.820234+-122.253880+37.820592+-122.254186+37.820972+-122.254447+37.821369+-122.254661+37.821781+-122.254826+37.822203+-122.254941+37.822633+-122.255004+37.823065+-122.255015+37.823113+-122.255010%22%29%3B%3E%3B%29%3Bout%3B"
Got all network data within polygon from API in 1 request(s) and 0.04 seconds
Creating networkx graph from downloaded OSM data...
Created graph with 5,578 nodes and 10,929 edges in 0.09 seconds
Added edge lengths to graph in 0.08 seconds
Identifying all nodes that lie outside the polygon...
Created r-tree spatial index for 5,578 points in 0.20 seconds
Traceback (most recent call last):
  File "/Users/liquidgenius/Projects/osmnx_maps/src/main.py", line 5, in <module>
    G = ox.graph_from_place('Piedmont, California, USA', network_type='drive')
  File "/Users/liquidgenius/Library/Caches/pypoetry/virtualenvs/osmnx-maps-4FpwlMfr-py3.8/lib/python3.8/site-packages/osmnx/core.py", line 1445, in graph_from_place
    G = graph_from_polygon(polygon, network_type=network_type, simplify=simplify,
  File "/Users/liquidgenius/Library/Caches/pypoetry/virtualenvs/osmnx-maps-4FpwlMfr-py3.8/lib/python3.8/site-packages/osmnx/core.py", line 1326, in graph_from_polygon
    G_buffered = truncate_graph_polygon(G_buffered, polygon_buffered, retain_all=True, truncate_by_edge=truncate_by_edge)
  File "/Users/liquidgenius/Library/Caches/pypoetry/virtualenvs/osmnx-maps-4FpwlMfr-py3.8/lib/python3.8/site-packages/osmnx/core.py", line 733, in truncate_graph_polygon
    points_within_geometry = intersect_index_quadrats(gdf_nodes, polygon, quadrat_width=quadrat_width, min_num=min_num, buffer_amount=buffer_amount)
  File "/Users/liquidgenius/Library/Caches/pypoetry/virtualenvs/osmnx-maps-4FpwlMfr-py3.8/lib/python3.8/site-packages/osmnx/core.py", line 680, in intersect_index_quadrats
    points_within_geometry = points_within_geometry.drop_duplicates(subset='node')
  File "/Users/liquidgenius/Library/Caches/pypoetry/virtualenvs/osmnx-maps-4FpwlMfr-py3.8/lib/python3.8/site-packages/pandas/core/frame.py", line 4808, in drop_duplicates
    duplicated = self.duplicated(subset, keep=keep)
  File "/Users/liquidgenius/Library/Caches/pypoetry/virtualenvs/osmnx-maps-4FpwlMfr-py3.8/lib/python3.8/site-packages/pandas/core/frame.py", line 4885, in duplicated
    labels, shape = map(list, zip(*map(f, vals)))
  File "/Users/liquidgenius/Library/Caches/pypoetry/virtualenvs/osmnx-maps-4FpwlMfr-py3.8/lib/python3.8/site-packages/pandas/core/frame.py", line 4859, in f
    labels, shape = algorithms.factorize(
  File "/Users/liquidgenius/Library/Caches/pypoetry/virtualenvs/osmnx-maps-4FpwlMfr-py3.8/lib/python3.8/site-packages/pandas/core/algorithms.py", line 629, in factorize
    codes, uniques = _factorize_array(
  File "/Users/liquidgenius/Library/Caches/pypoetry/virtualenvs/osmnx-maps-4FpwlMfr-py3.8/lib/python3.8/site-packages/pandas/core/algorithms.py", line 478, in _factorize_array
    uniques, codes = table.factorize(values, na_sentinel=na_sentinel, na_value=na_value)
  File "pandas/_libs/hashtable_class_helper.pxi", line 1806, in pandas._libs.hashtable.PyObjectHashTable.factorize
  File "pandas/_libs/hashtable_class_helper.pxi", line 1726, in pandas._libs.hashtable.PyObjectHashTable._unique
TypeError: unhashable type: 'dict'
liquidgenius commented 4 years ago

Uninstalled pyenv and pipenv, installed Python 3.8.1 in pyenv, set the local project to 3.8.1 and ran pipenv shell, then pipenv install osmnx.

Running the same minimal code as listed previously also has the same failure message.

So to boil this down both Poetry or Pipenv installations with Python 3.8+ are having the same error.

What versions of Python is osmnx verified to work with?

gboeing commented 4 years ago

Thanks. An update in a dependency has changed how node IDs get turned into a DataFrame. This specific issue is fixed now and I'm looking to see if it affects anything elsewhere.