Search code examples
segmentation-faultpython-3.9osmnx

OSMNx, Segmentation Fault (core dumped)


I work with osmnx to a urban project . I have a problem when run in python 3.9.1 the follow example:

import osmnx as ox
import networkx as nx

point = 37.858495, -122.267468
G = ox.graph_from_point(point, network_type="drive", dist=500)
G_proj = ox.project_graph(G)
intersections = ox.consolidate_intersections(
    G_proj, rebuild_graph=False, tolerance=15, dead_ends=False)

from: github

Python exit by "Segmentation Fault (core dumped)" error. The other main examples of osmnx work fine in my PC. I don't know why this not work, any idea? The PC RAM is not full, I use osmnx version 1.0.1.

Thanks in advance for your precious time.


Solution

  • This should be fixed now in OSMnx. You can either install the main branch from Github to get the fix early, or wait for v1.1 to be released in early May 2021. The issue seemed to take different guises depending on your operating system, including kernel restarting, OSError, segmentation fault, and stack overflow errors that can occur if you're using GeoPandas with pygeos installed.