【发布时间】:2018-01-03 09:04:22
【问题描述】:
我正在尝试像这样在 geopandas 中打开一个形状文件:
import geopandas as gpd
shp = gpd.read_file("C:\my_file.shp")
但这会返回错误:
Traceback (most recent call last):
File "<ipython-input-5-d0665b3cc874>", line 3, in <module>
shp = gpd.read_file("C:\my_file.shp")
AttributeError: module 'geopandas' has no attribute 'read_file'
我也尝试过这样做:
from geopandas import GeoSeries, GeoDataFrame
返回:
Traceback (most recent call last):
File "<ipython-input-6-338cbf14bf64>", line 1, in <module>
from geopandas import GeoSeries, GeoDataFrame
File "C:\Users\spotter\Documents\Python_Scripts\geopandas.py", line 1, in <module>
from geopandas import GeoSeries, GeoDataFrame
ImportError: cannot import name 'GeoSeries'
我正在使用 anaconda3-5.0.1 并使用 conda install -c conda-forge geopandas 安装 geopandas
编辑:
我刚刚下载了anaconda2,geopandas工作正常,所以这与anaconda3有关
【问题讨论】:
-
你有一个名为
geopandas.py的本地模块吗?