Python - Geopandas什么都没有用

时间:2018-03-20 07:57:24

标签: python anaconda geopandas

嗨,这是我关于堆栈溢出的第一篇文章。我对python完全不熟悉,我对R和.Net有一些经验,但想要进入python并尝试一下。我安装了Anaconda,我已经安装了Geopandas软件包。运行Windows,我正在运行python 3.6(最新版本最好吗?)

我想对空间数据集进行分析。

但是我只是导入了我的geopandas库而被阻止了。

import geopandas as gpd
states = gpd.read_file('states.geojson')
print(states.head())
---------------------------------------------------------------------------
UnicodeEncodeError                        Traceback (most recent call last)
<ipython-input-15-564808c3c6e6> in <module>()
----> 1 import geopandas as gpd
      2 states = gpd.read_file('states.geojson')
      3 print(states.head())

~\Anaconda3\lib\site-packages\geopandas\__init__.py in <module>()
----> 1 from geopandas.geoseries import GeoSeries
      2 from geopandas.geodataframe import GeoDataFrame
      3 
      4 from geopandas.io.file import read_file
      5 from geopandas.io.sql import read_postgis

~\Anaconda3\lib\site-packages\geopandas\geoseries.py in <module>()
      4 import numpy as np
      5 from pandas import Series
----> 6 import pyproj
      7 from shapely.geometry import shape, Point
      8 from shapely.geometry.base import BaseGeometry

~\Anaconda3\lib\site-packages\pyproj\__init__.py in <module>()
    249 #    raise IOError(msg)
    250 
--> 251 set_datapath(pyproj_datadir)
    252 
    253 class Proj(_proj.Proj):

_proj.pyx in _proj.set_datapath (_proj.c:887)()

_proj.pyx in _proj._strencode (_proj.c:3939)()

UnicodeEncodeError: 'ascii' codec can't encode character '\xfc' in position 15: ordinal not in range(128)

1 个答案:

答案 0 :(得分:0)

也许它没有正确安装。通过你的命令提示符试试这个:

>>> import geopandas
>>> geopandas.__version__
'0.6.1'

如果您看到不同的东西,请尝试“pip install geopandas”