[英]Install geopandas in Pycharm
Sorry if this is a repeat question, But I am new to Python and trying to install Geopandas in Pycharm.抱歉,如果这是一个重复的问题,但我是 Python 的新手,并试图在 Pycharm 中安装 Geopandas。 My python version is 3.7.2.
我的 python 版本是 3.7.2。
pip install geopandas
pip install geopandas
Both show same error.两者都显示相同的错误。
A GDAL API version must be specified.
必须指定 GDAL API 版本。 Provide a path to gdal-config using a GDAL_CONFIG environment variable or use a GDAL_VERSION environment variable.
使用 GDAL_CONFIG 环境变量或使用 GDAL_VERSION 环境变量提供 gdal-config 的路径。 ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output
错误:命令出错,退出状态为 1:python setup.py egg_info 检查日志以获取完整命令 output
Please provide steps to follow wrt Pycharm if possible.如果可能,请提供遵循 wrt Pycharm 的步骤。
According to Geopandas's own install instructions , the recommended way is to install via conda package manager, which you can obtain by using the Anaconda or miniconda Python distributions:根据Geopandas 自己的安装说明,推荐的方式是通过conda package 管理器安装,您可以使用Anaconda或miniconda ZA7F5F35426B9274117FC9231B5638 发行版获得
conda install geopandas
If, however, you have a Very Good Reason you can't use conda
, and absolutely need to use pip
, you should try installing GDAL first ( pip install GDAL
), and then checking if the gdal-config
command is in your path (ie that you can access it via the terminal).但是,如果您有一个非常好的理由不能使用
conda
,并且绝对需要使用pip
,则应先尝试安装 GDAL ( pip install GDAL
),然后检查gdal-config
命令是否在您的路径中(即您可以通过终端访问它)。 Then you can try installing again from either PyCharm directly or via the command line.然后您可以尝试直接从 PyCharm 或通过命令行再次安装。
If you can't get it installed from PyCharm and need to specify GDAL_VERSION
(which you can get with gdal-config --version
), you'll probably need to install from the command line, where you can set this variable either with an export
or directly in the same invocation:如果您无法从 PyCharm 安装它并且需要指定
GDAL_VERSION
(您可以使用gdal-config --version
获得),您可能需要从命令行安装,您可以在其中使用export
或直接在同一调用中:
GDAL_VERSION=2.4.2 pip install geopandas
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.