-
Notifications
You must be signed in to change notification settings - Fork 892
[Question] Complete opencv installation using pip #7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Do you mean by "complete installation" the Python bindings? Currently there is no pre-built packages for the OpenCV Python bindings on PyPI (=Python package index), but the aim of this repository is to provide them when we get all the builds stable (Linux and Windows are just about ready, but OS X needs more work). I have been very busy lately, but I'm going to focus more on this during next week so the packages should be available on PyPI soon. In practice this means that when we are ready to push all of these wheels (=python's pre-built packages) to PyPI, one could simply install the OpenCV package with following command:
and use it with the following import statement:
If your project is simple, then you could just add the If you're using Windows, you can already install the opencv-python package manually by downloading a package from Appveyor https://ci.appveyor.com/project/skvark/opencv-python/build/artifacts and installing it with pip:
|
I feel very badly about not being able to formulate my question properly due to lack of Python terminology knowledge. Basically, I mean, I'm looking for a "ready to go" Python package that I can refer in my project. I expect this to result in my code downloading OpenCV as a dependency regardless of the platform it runs on, i.e. platform specific binaries.
This seems to be the way to go but it won't work in windows for me:
Manual installation is exactly what I am trying to avoid. :) Offtopic: I'd really appreciate you pointing me to documents that explain Python packaging so that I'm not asking stupid questions in stupid forms anymore. 😞 |
It's not a problem :) Python's packaging is currently a bit complicated: there are many ways to do it, but most of them are legacy. You can read more about the packaging from here: https://packaging.python.org/ In brief, this repository is simply just a bunch of automated build scripts (meant to be run on CI systems like Travis and Appveyor) which will compile OpenCV and embed it to a python wheel package. During the compilation the C++ code is wrapped in a special python compatible way (http://docs.opencv.org/3.1.0/da/d49/tutorial_py_bindings_basics.html#gsc.tab=0). The end result is shared library which is then copied to the actual Python package and can be imported with python. This process is repeated multiple times for every platform (this is not a so called universal package due to an binary extension) and all the results will be uploaded to PyPI (in the future). For example, you can have a look at numpy and observe the many different .whl files for different platforms: https://pypi.python.org/pypi/numpy
|
@skvark Thanks! Your intro is helpful! I don't think there's need in keeping this issue open. (btw, windows installation of wheel did actually work for me). Olli-Pekka, is there a way for me to contact you directly regarding OpenCV or Python? I have 10 years of experience with .NET/Java and would love to be able to ramp up with Python quickly. Considering the style and structure of your explanatory messages, I believe you can be very helpful as a mentor for me. So, if you have time and are willing to I'd write you questions time to time. Let me know. |
You can contact me for example via Twitter, I'll share my email address privately. |
Sorry if this should be painfully obvious already, but I am still in need of clarification. Let's suppose I am on a machine on which openCV has not been installed. Will |
In practice this means that pretty much the whole OpenCV API is available via Python by importing If you want to use OpenCV for example via C++ or some other language, then you have to install the whole official package from here: https://github.com/opencv/opencv/releases If you are interested in how the bindings are generated, have a look at this: http://docs.opencv.org/3.2.0/da/d49/tutorial_py_bindings_basics.html |
@skvark thanks, that helps a lot. So, in other words, as long as the user only needs to interact with opencv through python, then Given that the full opencv build is not trivial, that's a nice accomplishment! |
Great. It might be worth making this point more clearly in your documentation. I am new to opencv but I am otherwise not a novice, yet I still had this confusion. All the more so because the documentation of opencv itself (to me) is extremely haphazard. Anyways, thanks again! |
I'll update the readme file. |
@ skvark , I get the following error on giving pip install opencv-python on my pi zero. Any suggestions
|
I'm sorry, this repository does not provide pre-built wheels for ARM-based platforms. You should contact the person who has created the wheels you are using. |
Alright , thanks for the quick reply @skvark !! |
i have error in my command prompt when i want to install opencv opencv-3.4.2-vc14_vc15. |
@ skvark could you assist below:
|
This is not a Q&A forum and the question you're asking is not even related to this repository. Ask your question at Stack Overflow. |
@skvark Hi, obviously I'm new to these problems but I have a weird problem. |
The name of this package is Ask your question at Stack Overflow. This is a issue tracker, not a Q&A forum. |
Hello Olli-Pekka,
First of all I must say thank you for starting this repository. I am very new to both Python and OpenCV.
I'm trying to start a new project that will intensively use OpenCV. Could you please clarify whether it is possible or not to have a complete OpenCV installation entirely based on pip or easy_install packages? If yes, than what are the steps I should follow.
Drawing a parallel with .NET/Java, I'd like to introduce a single dependency on NuGet/Maven package of OpenCV. In my scenario, development is going to be all in Python, though.
I understand, this question does not really belong here but I can't find a better place and more knowledgeable person to get it answered.
Thanks!
The text was updated successfully, but these errors were encountered: