[英]Jupyter Notebook not finding Anaconda openccv module
I'm using Anaconda to manage a python environment, and running a Jupyter Notebook from it.我正在使用 Anaconda 来管理 python 环境,并从中运行 Jupyter Notebook。 I've installed nb_conda and nb_conda_kernels, and opencv is listed among the installed conda packages when I view them from the Conda tab of the Jupyter Notebook.
我已经安装了 nb_conda 和 nb_conda_kernels,当我从 Jupyter Notebook 的 Conda 选项卡查看 opencv 时,它们会列在已安装的 conda 包中。 Despite this, when I run the notebook and it goes through the imports,
尽管如此,当我运行笔记本并通过导入时,
import os
import sys
import random
import math
import re
import time
import numpy as np
import opencv
it hits a ModuleNotFoundError: No module named 'opencv'它遇到 ModuleNotFoundError: No module named 'opencv'
I have set the notebook to use the conda environment that has opencv installed, and opencv is listed among the installed packages in the "conda packages" section of the kernel tab in the notebook.我已将笔记本设置为使用安装了 opencv 的 conda 环境,并且 opencv 列在笔记本中 kernel 选项卡的“conda 包”部分的已安装包中。 And yet it still can't find opencv for some reason when I try to run the cells in the notebook.
然而,当我尝试在笔记本电脑中运行单元格时,由于某种原因,它仍然找不到 opencv。
If it is relevant, I also have ipykernel installed on the same environment.如果相关,我也在同一环境中安装了 ipykernel。 The notebook also appears to not be finding any available conda packages for download when I open up the Conda Packages section of the kernel tab.
当我打开 kernel 选项卡的 Conda 包部分时,笔记本似乎也没有找到任何可用的 conda 包可供下载。
I'm new to using conda, and this is my first time trying to combine it with Jupyter Notebook.我是使用 conda 的新手,这是我第一次尝试将它与 Jupyter Notebook 结合使用。 How can I get the notebook to use the opencv package that is installed?
如何让笔记本使用安装的 opencv package?
@cel found the issue, it was fixed by running %conda install opencv
first @cel 发现问题,通过运行
%conda install opencv
先修复
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.