# Is opencv dependent on python3.10

**URL:** <https://forum.opencv.org/t/is-opencv-dependent-on-python3-10/10264>\
**Category:** Python\
**Tags:** build, apple\
**Created:** [September 20, 2022, 3:53pm UTC](https://forum.opencv.org/t/is-opencv-dependent-on-python3-10/10264 "2022-09-20T15:53:40Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![BobR](https://avatars.discourse-cdn.com/v4/letter/b/96bed5/32.png) [@BobR](https://forum.opencv.org/u/BobR)\
**Post date:** [September 20, 2022, 3:53pm UTC](https://forum.opencv.org/t/is-opencv-dependent-on-python3-10/10264/1 "2022-09-20T15:53:40Z")

</div>

I am not sure if my problem is with opencv or GitHub. When I use GitHub via brew command to install opencv, there is a dependency for python3.10 so this only installs cv2 in a python3.10 directory. This causes a module not found error when attempting to import cv2 using the current version of python3.9.14.

---

<div class="post-metadata">

**Author:** ![crackwitz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/crackwitz/32/14_2.png) [@crackwitz](https://forum.opencv.org/u/crackwitz)\
**Post date:** [September 20, 2022, 4:27pm UTC](https://forum.opencv.org/t/is-opencv-dependent-on-python3-10/10264/2 "2022-09-20T16:27:21Z")

</div>

why DIY when there are packages you can simply install with `pip`?

the official binary package of `opencv-python` is suitable for python 3.6+ because it uses a stable/reduced python ABI. there are binary builds for some recent apple OS versions, so you’d only _have to_ build opencv and the python module yourself once your apple device is declared e-waste.

if you build opencv yourself, cmake will look for a python, any python, hopefully the latest version one, and pick that one python, and the generated “install” target will only copy the python module into that python.

I don’t know if the opencv source tree itself does the “reduced python ABI” building or whether the `opencv-python` build scripts do that specifically. I’d bet on the first, so _probably_ the generated `cv2.pyd` should work with python 3.9 too, if you copy it into the right place.

related: [python - With Homebrew opencv appears to be only for python3.10, any chance of getting a version for 3.9? - Stack Overflow](https://stackoverflow.com/questions/73791423/with-homebrew-opencv-appears-to-be-only-for-python3-10-any-chance-of-getting-a)

---

<div class="post-metadata">

**Author:** ![BobR](https://avatars.discourse-cdn.com/v4/letter/b/96bed5/32.png) [@BobR](https://forum.opencv.org/u/BobR)\
**Post date:** [September 20, 2022, 4:38pm UTC](https://forum.opencv.org/t/is-opencv-dependent-on-python3-10/10264/3 "2022-09-20T16:38:04Z")

</div>

I’ll look into using PIP. I have always used Homebrew since it does not require me to DIY anything keeps different versions separate but it is dependent on the formula on GitHub. I did look at some of the packages installed for python3.10 since I was considering just moving them to the python3.9 directories but most all of them referenced the python3.10 path.

Thanks
