- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
As the title,
I'm using the openvino 2021.R1 version.
When I import the opencv to my own code, will report error.
Like this:
"ImportError: DLL load failed while importing cv2"
This situation is occurring to the Openvino environment initialized done.
If initialize done, the python can not be imported the Opencv.
But, I changed to Anaconda environment.
The python can imported openvino-opencv.
Like this:
Best regards,
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Looks like OpenVINO does not fully support Python 3.8 on Windows yet, because in this version PATH environment variable is not used to find DLLs when loading the module (see https://docs.python.org/3/whatsnew/3.8.html#changes-in-the-python-api).
As a workaround try to manually call "os.add_dll_directory" with path to "<openvino>/opencv/bin". If it does not help try to call add_dll_directory for each of location which setupvars.bat script adds to the PATH variable (paths starting in <openvino> root).
Or use Python 3.7.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dear Maksim,
Thank you for your reply.
But, I don't understand.
I'm very confused, when using Anaconda to import opencv, this problem will be solved.
Also, I'm trying your provide a method, manually call "os.add_dll_directory" this API.
It's seems not working,too.
The reason of I want to use python 3.8, is the memory shared are only supported python version>=3.8.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm very confused, when using Anaconda to import opencv, this problem will be solved.
I believe conda python applies patches reverting mentioned behavior.
Also, I'm trying your provide a method, manually call "os.add_dll_directory" this API.
It's seems not working,too.
I tried with python 3.8.6 from the official site and it worked for me, please check whether you used double backslash in paths:
os.add_dll_directory("C:\\openvino_2021.1\\deployment_tools\\ngraph\\lib")
os.add_dll_directory("C:\\openvino_2021.1\\deployment_tools\\inference_engine\\external\\tbb\\bin")
os.add_dll_directory("C:\\openvino_2021.1\\deployment_tools\\inference_engine\\bin\\intel64\\Release")
os.add_dll_directory("C:\\openvino_2021.1\\deployment_tools\\inference_engine\\external\\hddl\\bin")
os.add_dll_directory("C:\\openvino_2021.1\\opencv\\bin")
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dear Maksim,
Thank you!
I'll try to add the other dll path, and test it!
Best regards,
Eddie
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi EddieChen,
Thanks for reaching out.
This happened because Python 3.8 is not fully supported for OpenVINO 2021.1 toolkit yet. I would suggest you install Python 3.7 version.
Meanwhile, the reason you can import OpenCV when using Anaconda might be the installation of the OpenVINO toolkit from Anaconda Cloud is not specify the version of the Phyton.
Regards,
Aznie
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dear Aznie,
Thank you a lot, I got it!
Wish upgrades openvino as soon as possible, which really powerful and convenient!
Best regards,
Eddie
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Eddie,
This thread will no longer be monitored since this issue has been resolved. If you need any additional information from Intel, please submit a new question.
Regards,
Aznie
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page