[英]Importing error in python package skimage
I want to use skimage.restoration.denoise_wavelet to denoise a image. 我想使用skimage.restoration.denoise_wavelet去噪图像。 But problem occurs on importing. 但是在导入时会出现问题。
from skimage.restoration import denoise_nl_means,denoise_wavelet
ImportError Traceback (most recent call last) <ipython-input-2-161a32d32528> in <module>() ----> 1 from skimage.restoration import denoise_nl_means,denoise_wavelet ImportError: cannot import name denoise_wavelet
There is no problem in importing denoise_nl_means which is in the same category with denoise_wavelet . 有进口denoise_nl_means这与denoise_wavelet同一类别没有问题。 It doesn't make sense. 这没有道理。
I used pip for installing and updating the skimage package and jupyter notebook for coding. 我使用pip来安装和更新skimage软件包,并使用jupyter笔记本进行编码。 I installed all requirements before installing scikit-image 0.12.3. 在安装scikit-image 0.12.3之前,我已经安装了所有要求。 The requirement items I installed were: 我安装的需求项是:
matplotlib 1.5.1,numpy 1.11.1,scipy 0.18.1,six 1.10.0,networkx 1.11,pillow 3.4.1,dask 0.10.0,PyWavelets 0.4.0
. matplotlib 1.5.1,numpy 1.11.1,scipy 0.18.1,six 1.10.0,networkx 1.11,pillow 3.4.1,dask 0.10.0,PyWavelets 0.4.0
。
As you installed this library with pip, it probably installed the latest stable release, which is something within the 0.12 branch. 当您使用pip安装此库时,它可能安装了最新的稳定版本,该版本位于0.12分支中。
There are different documentations for different versions of scikit-learn. scikit-learn的不同版本有不同的文档。 The function which you want to import does not exist yet in any stable branch if we interpret the following correctly: 如果我们正确地解释了以下内容,则您要导入的函数 在任何稳定分支中都不存在 :
Search for function-name in docs of development-branch : OK! 在development-branch的文档中搜索function-name :好!
Search for function-name in docs of 0.12 branch No hits! 在0.12分支的文档中搜索函数名称 。
Sadly, the docs of scikit-image do not say when a function was added to the library (as done by scipy). 令人遗憾的是,scikit-image的文档没有说明函数何时添加到库中(由scipy完成)。
Further analysis can be done on github + blame here . 可以在github + blame上进行进一步的分析。
So if you need this function, grab the development-branch and install from sources! 因此,如果您需要此功能,请抓住开发分支并从源代码安装! Always read the corresponding doc-versions! 请务必阅读相应的文档版本!
使用以下命令:
pip install -U https://github.com/scikit-image/scikit-image/archive/master.zip
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.