You aren’t providing much to go on here. Why did you try both pip
and conda
? Where did you try those install commands you provided?
(For future reference, if you have Anaconda/conda involved then that is your primary package manager by your opt in to use it. You should only use pip
in that case for things that don’t have conda receipes. Otherwise, you’ll create headaches for yourself.)
Assuming you have Anaconda/conda…
In the notebook where you want to use opencv, run the following in a new cell:
%conda install conda-forge::opencv
That is based on here and the use of the magic conda install command.
After that runs successfully (it probably will take quite a while to solved the environment before it completes), you can then restart the kernel and try the import statement.