python - 在 Jupyter Notebook 中找不到 OpenCV,但在终端中找到

标签 python opencv jupyter-notebook anaconda

这个问题在这里已经有了答案:





Conda environments not showing up in Jupyter Notebook

(22 个回答)


1年前关闭。




我使用'''conda-forge'''在我的环境中安装了openCV。
它适用于我的终端

❯ python
Python 3.8.2 (default, Mar 26 2020, 10:43:30) 
[Clang 4.0.1 (tags/RELEASE_401/final)] :: Anaconda, Inc. on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import cv2

But it doesn't work on my Jupyter Notebook

import cv2
---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
<ipython-input-1-c8ec22b3e787> in <module>
----> 1 import cv2

ModuleNotFoundError: No module named 'cv2'
我正在使用 Python 3.8.2。它显示在我的 conda 列表和 anaconda 的环境包列表中。请帮忙。
The images show both environments having the openCV package

最佳答案

谢谢@特伦顿。

python -m ipykernel install --user --name Vision --display-name "Python (Vision)" 
然后从 Jupyter Notebook 中选择 Python(视觉)解决了这个问题!

关于python - 在 Jupyter Notebook 中找不到 OpenCV,但在终端中找到,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62491534/

相关文章:

php - 如何设计短信服务?

python - 在 Django 中使用 POST 的参数显示 matplotlib 生成的多张图片

python - 如何取消 Python 中的函数?

java - 将 MatOfPoint2f 转换为 MatOfPoint

opencv - 查找最适合的图像

jupyter-notebook - 在 bqplot 中动态调整轴

python - 使用质数输入维度训练 CNN 的问题

javascript - 在给定状态 ID 的 iPython Notebook 中嵌入推文

python - Jupyter笔记本: TypeError: __init__() got an unexpected keyword argument 'io_loop'

c++ - 从 32 位迁移到 64 位 - OpenCV/MinGW/Eclipse