[英]No module named 'skimage'
I'm importing skimage in a python code.我在 python 代码中导入 skimage。
from skimage.feature import greycomatrix, greycoprops
and I get this error我得到这个错误
No module named 'skimage'没有名为“skimage”的模块
Although I've already installed the scikit-image.虽然我已经安装了 scikit-image。 Can anyone help?任何人都可以帮忙吗?
This is the output of pip freeze这是 pip 冻结的 output
Since pip freeze indeed shows scikit-image as installed, I presume that you are launching your script/session using a different environment from the one listed by pip.由于 pip freeze 确实显示 scikit-image 已安装,我假设您正在使用与 pip 列出的环境不同的环境启动脚本/会话。 You should make sure that you are in the same environment.您应该确保您处于相同的环境中。 Try python -m pip freeze
and python my_script.py
from the same terminal to make sure that you are comparing the same environment.从同一终端尝试python -m pip freeze
和python my_script.py
以确保您正在比较相同的环境。
RealPython has a decent guide on Python environments here . RealPython 在 Python 环境中有一个不错的指南。
You can use pip install scikit-image
.您可以使用pip install scikit-image
。
Also, see the recommended procedure .此外,请参阅推荐的程序。
If you are using python3 you should install the package using python3 -m pip install package_name
or pip3 install package_name
如果您使用的是 python3,您应该使用python3 -m pip install package_name
或pip3 install package_name
安装 package
Using the pip
binary will install the package for python2
on some systems.使用pip
二进制文件将在某些系统上为python2
安装 package。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.