【问题标题】:Geopandas error message during installationGeopandas 安装过程中的错误消息
【发布时间】:2020-10-06 01:35:38
【问题描述】:

我正在尝试安装 geopandas。我使用了我找不到的代码,但我不断收到错误消息。我已经安装了geopy,但无法安装geopandas

我在使用 anaconda 提示符运行安装时得到的结果:

我也尝试过使用%pip install geopandas --user进行安装

Collecting geopandas
  Using cached geopandas-0.8.1-py2.py3-none-any.whl (962 kB)
Collecting pyproj>=2.2.0
  Using cached pyproj-2.6.1.post1-cp38-cp38-win32.whl (15.7 MB)
Collecting shapely
  Using cached Shapely-1.7.1-cp38-cp38-win32.whl (894 kB)
Requirement already satisfied: pandas>=0.23.0 in c:\users\fejiro\anaconda3\lib\site-packages (from geopandas) (1.0.5)
Collecting fiona
  Using cached Fiona-1.8.17.tar.gz (1.3 MB)
Note: you may need to restart the kernel to use updated packages.
    ERROR: Command errored out with exit status 1:
     command: 'C:\Users\fejiro\anaconda3\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\fejiro\\AppData\\Local\\Temp\\pip-install-q86d5ghj\\fiona\\setup.py'"'"'; __file__='"'"'C:\\Users\\fejiro\\AppData\\Local\\Temp\\pip-install-q86d5ghj\\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\fejiro\AppData\Local\Temp\pip-pip-egg-info-64u_nnsk'
         cwd: C:\Users\fejiro\AppData\Local\Temp\pip-install-q86d5ghj\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.

谁能告诉我该怎么做?

【问题讨论】:

  • 从截图来看,您似乎试图在 base/root 环境中安装软件包。不要那样做!最好始终为每个应用程序/项目创建一个单独的环境。这几乎肯定是第一个错误的原因。
  • 感谢您的回复。如何创建新环境?
  • 在找到安装新环境的方法后终于修复

标签: python geopandas


【解决方案1】:

对于更复杂的包最好使用 Anaconda 发行版。使用 install anaconda 然后为项目创建环境。之后,您可以使用conda-forge 处理所有兼容性问题

【讨论】:

  • 好的。感谢您的答复。如何创建新环境?
  • 在找到安装新环境的方法后终于修复了
  • 如果您要从 conda-forge 获取几乎所有的软件包,那么下载 Anaconda 有什么意义?
  • 你可以在没有 Anaconda 的情况下使用 conda-forge 吗?
猜你喜欢
  • 2020-02-11
  • 1970-01-01
  • 1970-01-01
  • 2011-06-25
  • 1970-01-01
  • 2015-10-15
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多