简体   繁体   中英

Jupyter Notebook not finding Anaconda openccv module

I'm using Anaconda to manage a python environment, and running a Jupyter Notebook from it. 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. 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'

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. And yet it still can't find opencv for some reason when I try to run the cells in the notebook.

If it is relevant, I also have ipykernel installed on the same environment. 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.

I'm new to using conda, and this is my first time trying to combine it with Jupyter Notebook. How can I get the notebook to use the opencv package that is installed?

@cel found the issue, it was fixed by running %conda install opencv first

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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