首页 > 解决方案 > 如何在 macOS Big Sur 上安装 OpenCV?

问题描述

所以基本上我有一个我正在做的项目,它需要 CV2 (OpenCV)。因此,在我的 Windows PC 上,我对所有 Python 包做了我所做的:pip3 install opencv-python它工作得非常好,我可以在那里使用 OpenCv。然后在我的 MacBook 上输入,python3 -m pip install opencv-python答案是:

Requirement already satisfied: opencv-python in /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages (4.5.2.54) Requirement already satisfied: numpy>=1.19.3 in /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages (from opencv-python) (1.19.5)

但是当我在 Atom 中并导入它时,会出现以下错误:

Traceback (most recent call last): File "/Users/janisklippel/Desktop/Programming/Test PCS/Test-Tracker", line 1, in <module> import cv2 ImportError: No module named cv2 [Finished in 0.074s]

但导入名称显然是 cv2。那么为什么它不起作用呢?

标签: pythonimageopencverror-handlingatom-editor

解决方案


推荐阅读