0
    C:\Users\white>pip install C:\Users\white\Downloads\geopandas-0.8.0-py2.py3-none-any.whl
Processing c:\users\white\downloads\geopandas-0.8.0-py2.py3-none-any.whl
Requirement already satisfied: shapely in c:\users\white\desktop\python\lib\site-packages (from geopandas==0.8.0) (1.7.0)
Collecting pyproj>=2.2.0
  Downloading pyproj-2.6.1.post1-cp36-cp36m-win_amd64.whl (17.3 MB)
     |████████████████████████████████| 17.3 MB 3.3 MB/s
Requirement already satisfied: pandas>=0.23.0 in c:\users\white\desktop\python\lib\site-packages (from geopandas==0.8.0) (0.24.1)
Collecting fiona
  Using cached Fiona-1.8.13.post1.tar.gz (1.2 MB)
    ERROR: Command errored out with exit status 1:
     command: 'c:\users\white\desktop\python\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\white\\AppData\\Local\\Temp\\pip-install-wt55_vfn\\fiona\\setup.py'"'"'; __file__='"'"'C:\\Users\\white\\AppData\\Local\\Temp\\pip-install-wt55_vfn\\fiona\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\white\AppData\Local\Temp\pip-install-wt55_vfn\fiona\pip-egg-info'
         cwd: C:\Users\white\AppData\Local\Temp\pip-install-wt55_vfn\fiona\
    Complete output (1 lines):
    A GDAL API version must be specified. Provide a path to gdal-config using a GDAL_CONFIG environment variable or use a GDAL_VERSION environment variable.
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
WARNING: You are using pip version 20.0.2; however, version 20.1.1 is available.
You should consider upgrading via the 'c:\users\white\desktop\python\python.exe -m pip install --upgrade pip' command.

这是我在尝试安装 geopandas 时遇到的错误,它在安装 Fiona 时失败。我试图通过 Windows whl 存储库中的 whl 安装 fiona,但它告诉我


C:\Users\white>pip install C:\Users\white\Downloads\Fiona-1.8.4-cp34-cp34m-win_amd64.whl
ERROR: Fiona-1.8.4-cp34-cp34m-win_amd64.whl is not a supported wheel on this platform.
WARNING: You are using pip version 20.0.2; however, version 20.1.1 is available.
You should consider upgrading via the 'c:\users\white\desktop\python\python.exe -m pip install --upgrade pip' command.
4

1 回答 1

1

欢迎。所以你可以做几件事。我正在运行 python 3.7,赢得 x64。

  1. 从这里获取 GDAL 二进制分布

  2. 我使用了GDAL-3.1.1-cp37-cp37m-win_amd64.whl。

  3. 然后我从这里下载了 Fiona whl ,特别是 Fiona-1.8.13-cp37-cp37m-win_amd64.whl。

安装

  1. 首先从上面的 2 安装 GDAL 二进制分发。
  2. 在同一命令提示符会话中设置 GDAL_VERSION=3.1.1。
  3. 修改您的 PATH 以包含 GDAL 包含文件,特别是 gdal.h 对我来说,位置是 %PYTHON_HOME%\Lib\site-packages\osgeo\include\gdal
    Like set PATH=%PYTHON_HOME%\Lib\site-packages\osgeo\include \gdal:%PATH%
  4. 然后从 Fiona-1.8.13-cp37-cp37m-win_amd64.whl 上方的第 3 点安装 Fiona。
  5. 最后,安装你的 geopandas 库。

下面是我的输出。

S:\so>pip install GDAL-3.1.1-cp37-cp37m-win_amd64.whl
Processing s:\so\gdal-3.1.1-cp37-cp37m-win_amd64.whl
Installing collected packages: GDAL
Successfully installed GDAL-3.1.1

S:\so>set GDAL_VERSION=3.1.1

set PATH=%PYTHON_HOME%\Lib\site-packages\osgeo\include\gdal\:%PATH%

S:\so>pip install Fiona-1.8.13-cp37-cp37m-win_amd64.whl
Processing s:\so\fiona-1.8.13-cp37-cp37m-win_amd64.whl
Requirement already satisfied: click>=4.0 in 
c:\users\so\appdata\local\programs\python\python37\lib\site-packages (from 
Fiona==1.8.13) (7.1.2)
Requirement already satisfied: attrs>=17 in 
c:\users\so\appdata\local\programs\python\python37\lib\site-packages (from 
Fiona==1.8.13) (19.3.0)
Requirement already satisfied: six>=1.7 in 
c:\users\so\appdata\local\programs\python\python37\lib\site-packages (from 
Fiona==1.8.13) (1.14.0)
Requirement already satisfied: click-plugins>=1.0 in 
c:\users\so\appdata\local\programs\python\python37\lib\site-packages (from 
Fiona==1.8.13) (1.1.1)
Requirement already satisfied: cligj>=0.5 in 
c:\users\so\appdata\local\programs\python\python37\lib\site-packages (from 
Fiona==1.8.13) (0.5.0)
Requirement already satisfied: gdal~=3.1.1 in 
c:\users\so\appdata\local\programs\python\python37\lib\site-packages (from 
Fiona==1.8.13) (3.1.1)
Requirement already satisfied: munch in 
c:\users\so\appdata\local\programs\python\python37\lib\site-packages (from 
Fiona==1.8.13) (2.5.0)
Installing collected packages: Fiona
Successfully installed Fiona-1.8.13



S:\so>pip install geopandas-0.8.0-py2.py3-none-any.whl
Processing s:\so\geopandas-0.8.0-py2.py3-none-any.whl
Requirement already satisfied: pyproj>=2.2.0 in 
c:\users\so\appdata\local\programs\python\python37\lib\site-packages (from 
geopandas==0.8.0) (2.6.1.post1)
Requirement already satisfied: fiona in 
c:\users\so\appdata\local\programs\python\python37\lib\site-packages (from 
geopandas==0.8.0) (1.8.13)
Requirement already satisfied: pandas>=0.23.0 in 
c:\users\so\appdata\local\programs\python\python37\lib\site-packages (from 
geopandas==0.8.0) (1.0.5)
Requirement already satisfied: shapely in 
c:\users\so\appdata\local\programs\python\python37\lib\site-packages (from 
geopandas==0.8.0) (1.7.0)
Requirement already satisfied: six>=1.7 in 
c:\users\so\appdata\local\programs\python\python37\lib\site-packages (from fiona- 
>geopandas==0.8.0) (1.14.0)
Requirement already satisfied: munch in 
c:\users\so\appdata\local\programs\python\python37\lib\site-packages (from fiona- 
>geopandas==0.8.0) (2.5.0)
Requirement already satisfied: attrs>=17 in 
c:\users\so\appdata\local\programs\python\python37\lib\site-packages (from fiona- 
>geopandas==0.8.0) (19.3.0)
Requirement already satisfied: cligj>=0.5 in 
c:\users\so\appdata\local\programs\python\python37\lib\site-packages (from fiona- 
>geopandas==0.8.0) (0.5.0)
Requirement already satisfied: click>=4.0 in 
c:\users\so\appdata\local\programs\python\python37\lib\site-packages (from fiona- 
>geopandas==0.8.0) (7.1.2)
Requirement already satisfied: click-plugins>=1.0 in 
c:\users\so\appdata\local\programs\python\python37\lib\site-packages (from fiona- 
>geopandas==0.8.0) (1.1.1)
Requirement already satisfied: gdal~=3.1.1 in 
c:\users\so\appdata\local\programs\python\python37\lib\site-packages (from fiona- 
>geopandas==0.8.0) (3.1.1)
Requirement already satisfied: numpy>=1.13.3 in 
c:\users\so\appdata\local\programs\python\python37\lib\site-packages (from 
pandas>=0.23.0->geopandas==0.8.0) (1.19.0)
Requirement already satisfied: python-dateutil>=2.6.1 in 
c:\users\so\appdata\local\programs\python\python37\lib\site-packages (from 
pandas>=0.23.0->geopandas==0.8.0) (2.8.1)
Requirement already satisfied: pytz>=2017.2 in 
c:\users\so\appdata\local\programs\python\python37\lib\site-packages (from 
pandas>=0.23.0->geopandas==0.8.0) (2020.1)
Installing collected packages: geopandas
Successfully installed geopandas-0.8.0

S:\so>python
Python 3.7.7 (tags/v3.7.7:d7c567b08f)
Type "help", "copyright", "credits" or "license" for more information.
>>> import geopandas
>>> geopandas.__version__
'0.8.0'
>>> geopandas.__file__
'C:\\Users\\so\\AppData\\Local\\Programs\\Python\\Python37\\lib\\site- 
 packages\\geopandas\\__init__.py'
 >>>

HTH

更多帮助安装 -> Windows 下。

于 2020-07-04T04:56:19.407 回答