python - 如何在 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。那么为什么它不起作用呢?
解决方案
推荐阅读
- laravel - 如何使用 laravel 从数据透视表中获取产品名称?
- java - 向 HTML“img src”选项添加高度或宽度时未加载图像
- ios - 保存状态 iOS - 离开应用程序时保存值 - Xamarin
- node.js - 尝试在 Electron 桌面应用程序中使用 oauth 流(使用 spotify API)?
- ruby-on-rails - 如何在 bootstrap 的 svg 图标上使用 link_to 函数
- r - 如何使用 Loops 或 Lapply 从矩阵中生成 100 个新变量?
- node.js - 如何从另一个创建 POST localhost 的应用程序中侦听或获取 React 应用程序中的 json?
- javascript - 如何在android中将javascript localstorage.setItem注入webview?
- javascript - 如何使用 FormData() 从 React Js 向 Nodejs、MongoDB 发送对象数组?
- python - Python3 - 如何在 pygame 混音器中改变声音的音量