Windows10在cmd中用pip安装imgaug的时候报错

G:\python\Pyhton36\Scripts>pip install imgaug
Collecting imgaug
  Downloading https://files.pythonhosted.org/packages/af/fc/c56a7da8c23122b7c5325b941850013880a7a93c21dc95e2b1ecd4750108/imgaug-0.2.7-py3-none-any.whl (644kB)
    100% |████████████████████████████████| 645kB 73kB/s
Requirement already satisfied: scikit-image>=0.11.0 in g:\python\pyhton36\lib\site-packages (from imgaug) (0.14.1)
Collecting imageio (from imgaug)
  Downloading https://files.pythonhosted.org/packages/28/b4/cbb592964dfd71a9de6a5b08f882fd334fb99ae09ddc82081dbb2f718c81/imageio-2.4.1.tar.gz (3.3MB)
    100% |████████████████████████████████| 3.3MB 438kB/s
Collecting Shapely (from imgaug)
  Downloading https://files.pythonhosted.org/packages/a2/fb/7a7af9ef7a35d16fa23b127abee272cfc483ca89029b73e92e93cdf36e6b/Shapely-1.6.4.post2.tar.gz (225kB)
    100% |████████████████████████████████| 235kB 181kB/s
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "", line 1, in 
      File "C:\Users\34905\AppData\Local\Temp\pip-install-43zide7u\Shapely\setup.py", line 80, in 
        from shapely._buildcfg import geos_version_string, geos_version, \
      File "C:\Users\34905\AppData\Local\Temp\pip-install-43zide7u\Shapely\shapely\_buildcfg.py", line 200, in 
        lgeos = CDLL("geos_c.dll")
      File "g:\python\pyhton36\lib\ctypes\__init__.py", line 348, in __init__
        self._handle = _dlopen(self._name, mode)
    OSError: [WinError 126] 找不到指定的模块。

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in C:\Users\34905\AppData\Local\Temp\pip-install-43zide7u\Shapely\

原因

imgaug中的shapely安装失败

解决方式

通过这个网址 https://www.lfd.uci.edu/~gohlke/pythonlibs/#shapely (这是一个非常好的扩展包非正式网址,建议大家mark起来) 中找到适合自己python版本的shapely下载到指定路径

Windows10在cmd中用pip安装imgaug的时候报错_第1张图片

然后通过以下命令

G:\python\Pyhton36\Scripts>python -m pip install Shapely-1.6.4.post1-cp36-cp36m-win_amd64.whl
Processing g:\python\pyhton36\scripts\shapely-1.6.4.post1-cp36-cp36m-win_amd64.whl
Installing collected packages: Shapely
Successfully installed Shapely-1.6.4.post1

接着再来尝试一次安装imgaug

G:\python\Pyhton36\Scripts>pip install imgaug
Collecting imgaug
  Using cached https://files.pythonhosted.org/packages/af/fc/c56a7da8c23122b7c5325b941850013880a7a93c21dc95e2b1ecd4750108/imgaug-0.2.7-py3-none-any.whl
Requirement already satisfied: Shapely in g:\python\pyhton36\lib\site-packages (from imgaug) (1.6.4.post1)
Requirement already satisfied: six in g:\python\pyhton36\lib\site-packages (from imgaug) (1.12.0)
Requirement already satisfied: Pillow in g:\python\pyhton36\lib\site-packages (from imgaug) (5.3.0)
Requirement already satisfied: scikit-image>=0.11.0 in g:\python\pyhton36\lib\site-packages (from imgaug) (0.14.1)
Requirement already satisfied: matplotlib in g:\python\pyhton36\lib\site-packages (from imgaug) (3.0.2)
Collecting imageio (from imgaug)
  Using cached https://files.pythonhosted.org/packages/28/b4/cbb592964dfd71a9de6a5b08f882fd334fb99ae09ddc82081dbb2f718c81/imageio-2.4.1.tar.gz
Requirement already satisfied: scipy in g:\python\pyhton36\lib\site-packages (from imgaug) (1.2.0)
Requirement already satisfied: numpy>=1.7.0 in g:\python\pyhton36\lib\site-packages (from imgaug) (1.15.4)
Requirement already satisfied: dask[array]>=0.9.0 in g:\python\pyhton36\lib\site-packages (from scikit-image>=0.11.0->imgaug) (1.0.0)
Requirement already satisfied: cloudpickle>=0.2.1 in g:\python\pyhton36\lib\site-packages (from scikit-image>=0.11.0->imgaug) (0.6.1)
Requirement already satisfied: networkx>=1.8 in g:\python\pyhton36\lib\site-packages (from scikit-image>=0.11.0->imgaug) (2.2)
Requirement already satisfied: PyWavelets>=0.4.0 in g:\python\pyhton36\lib\site-packages (from scikit-image>=0.11.0->imgaug) (1.0.1)
Requirement already satisfied: kiwisolver>=1.0.1 in g:\python\pyhton36\lib\site-packages (from matplotlib->imgaug) (1.0.1)
Requirement already satisfied: cycler>=0.10 in g:\python\pyhton36\lib\site-packages (from matplotlib->imgaug) (0.10.0)
Requirement already satisfied: pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.1 in g:\python\pyhton36\lib\site-packages (from matplotlib->imgaug) (2.3.0)
Requirement already satisfied: python-dateutil>=2.1 in g:\python\pyhton36\lib\site-packages (from matplotlib->imgaug) (2.7.5)
Requirement already satisfied: toolz>=0.7.3; extra == "array" in g:\python\pyhton36\lib\site-packages (from dask[array]>=0.9.0->scikit-image>=0.11.0->imgaug) (0.9.0)
Requirement already satisfied: decorator>=4.3.0 in g:\python\pyhton36\lib\site-packages (from networkx>=1.8->scikit-image>=0.11.0->imgaug) (4.3.0)
Requirement already satisfied: setuptools in g:\python\pyhton36\lib\site-packages (from kiwisolver>=1.0.1->matplotlib->imgaug) (39.0.1)
Building wheels for collected packages: imageio
  Running setup.py bdist_wheel for imageio ... done
  Stored in directory: C:\Users\34905\AppData\Local\pip\Cache\wheels\e0\43\31\605de9372ceaf657f152d3d5e82f42cf265d81db8bbe63cde1
Successfully built imageio
Installing collected packages: imageio, imgaug
Successfully installed imageio-2.4.1 imgaug-0.2.7

大功告成!

你可能感兴趣的:(机器视觉)