简体   繁体   English

ModuleNotFoundError:没有名为“utils.image_classifier”的模块

[英]ModuleNotFoundError: No module named 'utils.image_classifier'

trying to run it this error is coming repeatedly nothing is working the following is the error:试图运行它这个错误反复出现没有任何工作以下是错误:

ModuleNotFoundError                       Traceback (most recent call last)
<ipython-input-19-86f6d90695b7> in <module>()
      2 import numpy as np
      3 
----> 4 from utils.image_classifier import ImageClassifier, NO_FACE_LABEL
      5 
      6 # Color RGB Codes & Font

ModuleNotFoundError: No module named 'utils.image_classifier'

I'm guessing you need to install some package or other.我猜你需要安装一些 package 或其他。 The import statement is looking for a python module (script file) called "image_classifier.py" in a sub-folder called "utils" somewhere in your path.导入语句正在路径中某个名为“utils”的子文件夹中查找名为“image_classifier.py”的 python 模块(脚本文件)。 That module needs to contain the class definition for ImageClassifier objects and what looks like a constant (variable assignment) called NO_FACE_LABEL.该模块需要包含 ImageClassifier 对象的 class 定义以及看起来像一个名为 NO_FACE_LABEL 的常量(变量赋值)。

I did a quick google but I couldn't find the package that might contain that module.我做了一个快速的谷歌搜索,但我找不到可能包含该模块的 package。 Are you aware of any pre-requisites for your code, things you need to have installed before you start?您是否知道代码的任何先决条件,在开始之前需要安装的东西?

Try:尝试:

pip install utils

If you've done it and it is still not working, you need to perform a search for "utils.py", and run your script on the same folder as in the "utils.py".如果您已经完成了它但仍然无法正常工作,您需要搜索“utils.py”,并在与“utils.py”相同的文件夹中运行您的脚本。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM