I am trying to get opencv 3.1 installed for Python on my Mac OS X 10.10.5 I'm following the steps as outlined here - http://www.pyimagesearch.com/2015/06/15/install-opencv-3-0-and-python-2-7-on-osx/
When I actually try installing opencv after all the setup, I get the following error:
.../opencv/modules/python/src2/cv2.cpp:6:10: fatal error: 'Python.h' file not found #include <Python.h> ^
I looked around StackOverflow and found that most people facing this issue are using Anaconda, which is not my case. It would be great if someone could point me in the right direction to get this fixed.
Thanks,
Python h no such file or directory is a fatal error. If you are trying to build a shared library using a C extension file, you need to install the development version of Python. For example, if you use Python 3, you need to install the python3-dev.
No usable version of opencv for Python 3.9 #281.
Python.h is nothing but a header file. It is used by gcc to build applications. You need to install a package called python-dev. This package includes header files, a static library and development tools for building Python modules, extending the Python interpreter or embedding Python in applications.
Usually, Python. h and all the header files it includes in it resides in include folder of Python's installation directory.
If Python.h is not found while making one of the *.cpp files, set the following ENV variable
export CPLUS_INCLUDE_PATH=/System/Library/Frameworks/Python.framework/Headers
Please check the existence of the path in your system and make sure that Python.h is there.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With