Ubuntu上没有名为scenedetect的模块

Ubuntu上没有名为scenedetect的模块

本文介绍了ImportError:在Linux Ubuntu上没有名为scenedetect的模块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在python上使用pyscenedetect库录制视频,但是在使用python接口时出现此错误,而在使用命令行界面时出现错误"ModuleNotFoundError:没有名为'cv2'的模块"

I'm trying to use pyscenedetect library on python for videos but I get this error when using the python interface and when I use the command line interface I get the error "ModuleNotFoundError: No module named 'cv2'"

即使我相信我已经根据文档正确安装了这两个产品.

even though I believe I installed both correctly according to the documentations.

我试图寻找第二种错误导入opencv的不同方法,但无济于事.至于第一个错误,我找不到我的问题的答案.

I have trying to look for different ways to import opencv for the second error but to no avail. As for the first error i can't find any answers to my problem.

import cv2
import numpy as numpy
import os

import scenedetect
from scenedetect.video_manager import VideoManager
from scenedetect.scene_manager import SceneManager
from scenedetect.frame_timecode import FrameTimecode
from scenedetect.stats_manager import StatsManager
from scenedetect.detectors import ContentDetector

推荐答案

我发现了问题.正如Ivan所指出的,问题出在openCV.

I found the problem. As Ivan was pointing out, the problem was with openCV.

我使用了以下命令:

sudo apt install python3-opencv

这篇关于ImportError:在Linux Ubuntu上没有名为scenedetect的模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-01 16:18