skimage-ImportError:DLL加载失败:找不到指定的模块

问题描述:

导入以下Python模块时遇到问题.我正在使用Jupyter,并且我导入的模块是-

I'm facing a problem while importing following Python module. I am working on Jupyter and my imported modules are -

import numpy as np
from scipy import misc
from skimage import data

在我尝试运行它时,出现以下错误.但是,我在Python 3.6和SciPy 1.0.0,scikit中使用 Anaconda -image 0.13.1,NumPy 1.14.0.

At the time I tried to run it, I got following errors. However, I'm using Anaconda with Python 3.6 and SciPy 1.0.0, scikit-image 0.13.1, NumPy 1.14.0.

ImportError                               Traceback (most recent call last)
<ipython-input-5-23140aba6e54> in <module>()
      3 from scipy import misc
      4 import matplotlib.pyplot as plt
----> 5 from skimage import data
      6 photo_data = misc.imread('F:\Python\Python for Data Science\Week 3\Week-3-Numpy\wifire\sd-3layers.jpg')

~\Anaconda3\lib\site-packages\skimage\data\__init__.py in <module>()
     14
     15 from .. import data_dir
---> 16 from ..io import imread, use_plugin
     17 from .._shared._warnings import expected_warnings
     18 from ._binary_blobs import binary_blobs

ImportError: DLL load failed: The specified module could not be found.

令人惊讶的是,几个月前我运行了相同的代码,现在还可以,现在出现这些错误,显示 ImportError ,并在Tracback中用箭头键指示 skimage .

Surprisingly I ran the same code few months ago and it's OK and now I'm getting these errors, showing the ImportError and indicating skimage with arrow keys in tracback.

因此,我认为此问题更多是与Windows系统相关的文件丢失问题,而不是明显的Python代码,因此我尝试通过此解决方案.但这对我不起作用.

So, I thought this problem is more about Windows system related missing file issue than Python code obvious, and so I tried to solved it by this solution. But it didn't work for me.

这是对我有用的解决方案之一.

This is one of the solutions that worked for me.

快速注释-在系统中,已安装的Python软件包为SciPy 1.0.0,scikit-image 0.13.1和imageio v 2.2.0.我正在使用 Anaconda Python 3.6 发行版.

Quick Note - in the system, installed Python packages were SciPy 1.0.0, scikit-image 0.13.1, and imageio v 2.2.0. I'm using the Anaconda Python 3.6 distribution.

解决方案

  • 卸载Anaconda(我需要这样做,但是您可能不需要这样做)
  • 下载 Visual C ++ 2017可再发行组件包(根据您的系统)
  • 同时安装重新分发文件和Anaconda,然后重新启动PC.

但是,我已经在系统上安装了NumPy + mkl.然后再次运行以下内容-

However, I've already installed NumPy + mkl on my system. Then run the following again-

from scipy import misc
photo_data = misc.imread('F:\Python\sd-3layers.jpg')

这一次,不是给我"DLL加载失败" 错误,而是给我信息-

And this time, rather than giving me the "DLL load failed" error, it gives me information -

C:\Users\P\Anaconda3\lib\site-packages\ipykernel_launcher.py:4: DeprecationWarning: `imread` is deprecated!
`imread` is deprecated in SciPy 1.0.0, and will be removed in 1.2.0.
Use ``imageio.imread`` instead.
  after removing the cwd from sys.path.

然后我尝试使用 imageio 包进行跟踪,并且运行正常.

Then I tried following, using the imageio package, and it ran properly.

import imageio
photo_data = imageio.imread('F:\Python\sd-3layers.jpg')