AttributeError: module 'osmnx' has no attribute 'project_gdf'

AttributeError: module 'osmnx' has no attribute 'project_gdf'

我已经成功下载osmnx 0.14.0版本

但是输出有这个错误:AttributeError: module 'osmnx' has no attribute 'project_gdf'

import matplotlib.pyplot as plt
import geopandas as gpd
import osmnx as ox
from descartes import PolygonPatch
from shapely.geometry import Point, LineString, Polygon, MultiPolygon

yerevan = gpd.read_file("C:/Users/Python/DataScience/data/Yerevan") 
city=ox.gdf_from_place("Yerevan,Armenia",which_result=2)
city=ox.project_gdf(city)
fig, ax=ox.plot_shape(city)

我该怎么做才能解决这个问题?我的 Python 版本是 3.8.3

import osmnx as ox
ox.config(use_cache=True, log_console=True)
city = ox.gdf_from_place("Yerevan, Armenia", which_result=2)
city = ox.projection.project_gdf(city)
ax = city.plot()
_ = ax.axis('off')

OSMnx 的大部分模块功能都可以直接在 ox. 命名空间中作为快捷方式使用。但任何没有的都可以通过 ox.module_name.function_name() 获得。有关详细信息,请参阅 docs

另请注意,plot_shape 函数在之前的版本中已被弃用并带有用户警告,并将在即将发布的版本中删除。

另请注意,which_result=2 将您的查询地理编码到埃里温的中心点。那是你想要的行为吗?如果您想要埃里温的边界多边形,请不要传递该参数或将其作为 which_result=1.

传递