You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

使用Python 2.7.14通过pip安装geopandas时出现egg_info错误码1问题

Fixing "python setup.py egg_info" Error When Installing Geopandas on Python 2.7.14

Hey there, let’s work through this annoying error you’re hitting when trying to install geopandas on Python 2.7.14. That python setup.py egg_info failure is almost always tied to either outdated packaging tools or incompatible dependency versions—and since Python 2.7 reached end-of-life years ago, geopandas has dropped official support for it. But don’t worry, we can still get it up and running with a few targeted steps.

Step 1: Upgrade pip and setuptools to their last Python 2.7-compatible versions

Older versions of pip and setuptools often cause egg_info errors because they don’t handle modern package metadata correctly. Run these commands to get the newest versions that still support Python 2.7:

pip install --upgrade pip==20.3.4
pip install --upgrade setuptools==44.1.1

Step 2: Install compatible versions of geopandas’ dependencies

Geopandas relies on libraries like Shapely, Fiona, PyProj, and Pandas—all of which have stopped supporting Python 2.7 in newer releases. Install these specific versions first:

pip install shapely==1.6.4.post2
pip install fiona==1.8.20
pip install pyproj==1.9.6
pip install pandas==0.24.2

Each of these is the final version of that library that works with Python 2.7, so they’ll play nicely together.

Step 3: Install the last Python 2.7-compatible geopandas release

Now that all dependencies are in place, install the final version of geopandas that supports Python 2.7:

pip install geopandas==0.8.2

Troubleshooting: Missing system libraries

If you still hit errors, you might be missing system-level libraries that the Python packages rely on. For example:

  • On Ubuntu/Debian-based Linux systems, run this to install required system packages:
    sudo apt-get install libgdal-dev libgeos-dev libproj-dev
    
  • On Windows, look for pre-compiled binary wheels for the dependency packages (like Fiona and Shapely) that are built for Python 2.7. You can install these local files directly with pip install /path/to/wheel-file.whl.

内容的提问来源于stack exchange,提问作者peter

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.27 04:13:48