什么时候安装 imgaug.py 我收到这个错误

When is install imgaug.py i get this error

这是一张关于我 problem.I 完全卡住了的图片。 https://ibb.co/hCx74JV

C:\Users\Staj>pip install imgaug
Collecting imgaug
  Using cached https://files.pythonhosted.org/packages/17/a9/36de8c0e1ffb2d86f871cac60e5caa910cbbdb5f4741df5ef856c47f4445/imgaug-0.2.9-py2.py3-none-any.whl
Requirement already satisfied: Pillow in e:\python\lib\site-packages (from imgaug) (5.4.1)
Collecting scikit-image>=0.11.0 (from imgaug)
  Using cached https://files.pythonhosted.org/packages/79/16/c5a36a03f90d4a246791d4ff1879f1868e1c5db58fac9f03427395c5e2d6/scikit_image-0.15.0-cp37-none-win_amd64.whl
Requirement already satisfied: six in e:\python\lib\site-packages (from imgaug) (1.12.0)
Collecting Shapely (from imgaug)
  Using cached https://files.pythonhosted.org/packages/a2/fb/7a7af9ef7a35d16fa23b127abee272cfc483ca89029b73e92e93cdf36e6b/Shapely-1.6.4.post2.tar.gz
    ERROR: Command errored out with exit status 1:
     command: 'e:\python\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\Staj\AppData\Local\Temp\pip-install-_wc8sxch\Shapely\setup.py'"'"'; __file__='"'"'C:\Users\Staj\AppData\Local\Temp\pip-install-_wc8sxch\Shapely\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 pip-egg-info
         cwd: C:\Users\Staj\AppData\Local\Temp\pip-install-_wc8sxch\Shapely\
    Complete output (9 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\Staj\AppData\Local\Temp\pip-install-_wc8sxch\Shapely\setup.py", line 80, in <module>
        from shapely._buildcfg import geos_version_string, geos_version, \
      File "C:\Users\Staj\AppData\Local\Temp\pip-install-_wc8sxch\Shapely\shapely\_buildcfg.py", line 200, in <module>
        lgeos = CDLL("geos_c.dll")
      File "e:\python\lib\ctypes\__init__.py", line 364, in __init__
        self._handle = _dlopen(self._name, mode)
    OSError: [WinError 126] The specified module could not be found
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

错误说明了一切。 The specified module could not be found 表示您没有安装一些必需的包。我猜你错过了 Shapely which is a requirement。下次按照文档中的安装步骤进行操作。或者用conda,更简单

错误可能是由于缺少构建 dll 所需的 C 编译器。 解决方法:

  1. https://www.lfd.uci.edu/~gohlke/pythonlibs/#shapely

  2. 安装二进制文件
  3. pip install Shapely-1.6.4.post2-cp37-cp37m-win_amd64.whl(在 Anaconda 环境下可以使用 conda install)