ImportError: scikit-learn must be installed to search an unprojected graph

Помогите пожалуйста

вот код

import osmnx as ox
import networkx as nx

ox.config(log_console=True, use_cache=True)

# define the start and end locations in latlng
start_latlng = (37.78497,-122.43327)
X1 = 37.78497
Y1 = -122.43327
end_latlng = (37.78071,-122.41445)

# location where you want to find your route
place = 'San Francisco, California, United States'

# find shortest route based on the mode of travel
mode = 'walk' # 'drive', 'bike', 'walk'

# find shortest path based on distance or time
optimizer = 'time' # 'length','time'

# create graph from OSM within the boundaries of some
# geocodable place(s)

graph = ox.graph_from_place(place, network_type = mode)

# find the nearest node to the start location
orig_node = ox.nearest_nodes(graph, X1, Y1)

# find the nearest node to the end location
dest_node = ox.nearest_nodes(graph, end_latlng)

# find the shortest path
shortest_route = nx.shortest_path(graph, orig_node,dest_node,
                              weight=optimizer)'''

вот ошибка

Traceback (most recent call last):
  File "C:\Users\User\PycharmProjects\TJ map\main.py", line 27, in <module>
    orig_node = ox.nearest_nodes(graph, X1, Y1)
  File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\osmnx\distance.py", line 
216, in nearest_nodes
    raise ImportError("scikit-learn must be installed to search an unprojected graph")
ImportError: scikit-learn must be installed to search an unprojected graph

Пожалуйста пишите реальное решение


Ответы (0 шт):