【问题标题】:Getting error code 1 while installing geopandas with pip使用 pip 安装 geopandas 时出现错误代码 1
【发布时间】:2018-12-07 01:11:26
【问题描述】:

这是我在尝试使用 pip install geopandas 安装 geopandas 时遇到的错误。我正在使用 Python 3.7。

Collecting geopandas
  Using cached https://files.pythonhosted.org/packages/24/11/d77c157c16909bd77557d00798b05a5b6615ed60acb5900fbe6a65d35e93/geopandas-0.4.0-py2.py3-none-any.whl
Collecting pyproj (from geopandas)
  Using cached https://files.pythonhosted.org/packages/29/72/5c1888c4948a0c7b736d10e0f0f69966e7c0874a660222ed0a2c2c6daa9f/pyproj-1.9.5.1.tar.gz
    Complete output from command python setup.py egg_info:
    using bundled proj4..
    Traceback (most recent call last):
      File "c:\users\public\anaconda3\lib\site-packages\setuptools\msvc.py", line 489, in _find_latest_available_vc_ver
        return self.find_available_vc_vers()[-1]
    IndexError: list index out of range

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\AVIMAT~1\AppData\Local\Temp\pip-install-hnb_xdmp\pyproj\setup.py", line 72, in <module>
        objects = cc.compile(['nad2bin.c', 'src/pj_malloc.c'])
      File "c:\users\public\anaconda3\lib\distutils\_msvccompiler.py", line 345, in compile
        self.initialize()
      File "c:\users\public\anaconda3\lib\distutils\_msvccompiler.py", line 238, in initialize
        vc_env = _get_vc_env(plat_spec)
      File "c:\users\public\anaconda3\lib\site-packages\setuptools\msvc.py", line 185, in msvc14_get_vc_env
        return EnvironmentInfo(plat_spec, vc_min_ver=14.0).return_env()
      File "c:\users\public\anaconda3\lib\site-packages\setuptools\msvc.py", line 843, in __init__
        self.si = SystemInfo(self.ri, vc_ver)
      File "c:\users\public\anaconda3\lib\site-packages\setuptools\msvc.py", line 485, in __init__
        self.vc_ver = vc_ver or self._find_latest_available_vc_ver()
      File "c:\users\public\anaconda3\lib\site-packages\setuptools\msvc.py", line 492, in _find_latest_available_vc_ver
        raise distutils.errors.DistutilsPlatformError(err)
    distutils.errors.DistutilsPlatformError: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": https://visualstudio.microsoft.com/downloads/

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in C:\Users\AVIMAT~1\AppData\Local\Temp\pip-install-hnb_xdmp\pyproj\

我已经尝试了很多其他方法,例如升级 setuptools 或下载 Fiona 和 GDAL 二进制文件,但似乎都不起作用。

【问题讨论】:

标签: python pip geopandas


【解决方案1】:

正如 Traceback 所说:下载这个

https://visualstudio.microsoft.com/downloads/

这将为您提供您正在安装的库所需的 C++ 库

【讨论】:

    【解决方案2】:

    问题在于编译pyproj。尝试从https://www.lfd.uci.edu/~gohlke/pythonlibs/#pyproj安装一个预编译的二进制文件

    【讨论】:

      【解决方案3】:

      this helped me out

      pip install wheel
      pip install pipwin
      
      pipwin install numpy
      pipwin install pandas
      pipwin install shapely
      pipwin install gdal
      pipwin install fiona
      pipwin install pyproj
      pipwin install six
      pipwin install rtree
      pipwin install geopandas
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2023-04-10
        • 2013-10-02
        • 1970-01-01
        • 2018-03-13
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多