我安装Geopandas时出了什么问题?

2024-03-28 17:40:37 发布

您现在位置:Python中文网/ 问答频道 /正文

我遵循了official instruction并尝试了pip install git+git://github.com/geopandas/geopandas.gitpip install geopandas,但我得到的只是下面的内容。不是电脑高手,我就是看不懂。有人能帮我弄清楚我应该怎么做才能成功安装geopandas

PS D:\Python\Scripts> pip install git+git://github.com/geopandas/geopandas.git
Collecting git+git://github.com/geopandas/geopandas.git
  Cloning git://github.com/geopandas/geopandas.git to c:\users\ariel\appdata\local\temp\pip-req-build-mzuz5obu
Requirement already satisfied: pandas>=0.24.0 in d:\python\lib\site-packages (from geopandas==0.8.0+52.g7e595d0) (1.0.3)
Collecting shapely>=1.6
  Using cached Shapely-1.7.1-cp38-cp38-win_amd64.whl (1.0 MB)
Collecting fiona>=1.8
  Using cached Fiona-1.8.17.tar.gz (1.3 MB)
    ERROR: Command errored out with exit status 1:
     command: 'd:\python\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\ariel\\AppData\\Local\\Temp\\pip-install-x28x2nrd\\fiona\\setup.py'"'"'; __file__='"'"'C:\\Users\\ariel\\AppData\\Local\\Temp\\pip-install-x28x2nrd\\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\ariel\AppData\Local\Temp\pip-pip-egg-info-kqm2six3'
         cwd: C:\Users\ariel\AppData\Local\Temp\pip-install-x28x2nrd\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.
PS D:\Python\Scripts>   

我也先尝试了pip install -U setuptools,结果并没有太大不同:

PS D:\Python\Scripts> pip install -U setuptools                                                                         Collecting setuptools
  Downloading setuptools-50.3.0-py3-none-any.whl (785 kB)
     |████████████████████████████████| 785 kB 1.1 MB/s
Installing collected packages: setuptools
  Attempting uninstall: setuptools
    Found existing installation: setuptools 41.2.0
    Uninstalling setuptools-41.2.0:
      Successfully uninstalled setuptools-41.2.0
Successfully installed setuptools-50.3.0
PS D:\Python\Scripts> pip install git+git://github.com/geopandas/geopandas.git
Collecting git+git://github.com/geopandas/geopandas.git
  Cloning git://github.com/geopandas/geopandas.git to c:\users\ariel\appdata\local\temp\pip-req-build-ujqm8v_3
Requirement already satisfied: pandas>=0.24.0 in d:\python\lib\site-packages (from geopandas==0.8.0+52.g7e595d0) (1.0.3)
Collecting shapely>=1.6
  Using cached Shapely-1.7.1-cp38-cp38-win_amd64.whl (1.0 MB)
Collecting fiona>=1.8
  Using cached Fiona-1.8.17.tar.gz (1.3 MB)
    ERROR: Command errored out with exit status 1:
     command: 'd:\python\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\ariel\\AppData\\Local\\Temp\\pip-install-no2ywi23\\fiona\\setup.py'"'"'; __file__='"'"'C:\\Users\\ariel\\AppData\\Local\\Temp\\pip-install-no2ywi23\\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\ariel\AppData\Local\Temp\pip-pip-egg-info-8o705rvl'
         cwd: C:\Users\ariel\AppData\Local\Temp\pip-install-no2ywi23\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.
PS D:\Python\Scripts>

我安装了Miniconda并尝试了指令中的内容:

PS D:\Python\Scripts> conda install geopandas
conda : The term 'conda' is not recognized as the name of a cmdlet, function, script file, or operable program. Check
the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ conda install geopandas
+ ~~~~~
    + CategoryInfo          : ObjectNotFound: (conda:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

Tags: installpipgitgithubcomegglocalusers