Closed skywo1f closed 3 years ago
The main reason for our Python 3.7 requirement is the support for Type checking because VimbaPython is based on a C API (VimbaC) and this allows us to make sure we are handing the expected data types over to that. If you need to use a version older than Python 3.7, this type checking needs to be disabled. Some time ago we got a similar request in #16 for support of older versions and there I explained how I was able to run some rudimentary tests with Python3.6. The general idea is to simply disable the runtime type checking by making the respective decorator a noop. To do this comment out the functionality in the RuntimeTypeCheckEnable.__call__
method (lines 55-58 in runtime_type_check.py).
However please be advised, that this will mean that you are using a non-validated combination of Python and VimbaPython which may contain unexpected bugs.
I hope this helps. It has been some time since I checked this method of getting VimbaPython to run on Python versions older than 3.7, so it is possible, that further modifications may be necessary. But as far as I remember there were no changes to VimbaPython that would require further intervention.
Ill check it out, thanks
That's great! Thanks a lot for explaining it. Would it be possible to have that as an install flag in the pip script by any chance? This would avoid the hassle with the Jetson Nano not being able to use python3.7 and opencv (without a gigantic mess ;-)
Well the runtime type check does have a purpose and adding support for yet another version of Python would mean that we have a lot more work to do during validation. Especially considering that for 3.6 an important safety aspect is not working.... There are currently no concrete plans for adding official support for Python3.6.
Adding to this: Everyone using python 3.6 should probably also keep in mind, that it is coming to end of life regarding official support anyway (scheduled for 2021-12-23): https://www.python.org/downloads/. I understand that there are probably some code bases, that rely on 3.6, but I would suggest updating to newer versions of python wherever possible.
I believe the following steps should get you a working python3.7 venv with opencv (just writing this from memory, steps were not checked to be correct. If they do not work please let me know so I can fix these instructions.):
python3.7 -m venv <name-of-venv>
)source <name-of-venv>/bin/activate
)python -m pip install -U pip
)pip install opencv-python
)python
on console and simply try import cv2
in that REPL)This is now possible thanks to OpenCV being available in a newer precompiled manylinux
format from pip and newer versions of pip supporting this format. You can find some more information on the PyPI page for opencv-python: https://pypi.org/project/opencv-python/
Ah, interesting! Thanks a lot for the note here. I tried explaining the procedure here. It took ages! Nice to see that it became a little easier :-)
Will try that out again.
I understand the first requirement is python version 3.7 or higher, but is there any way to run it with an earlier python? I am trying to run a neural network code, but it only supports python up to 3.6. Basically I am having to do something like python3.8 video.py | python3.6 ml.py where I am piping through images a byte at a time. This works for one image, but doing a stream of images also causes problems.
any ideas?