Intel® Distribution of OpenVINO™ Toolkit
Community support and discussions about the Intel® Distribution of OpenVINO™ toolkit, OpenCV, and all things computer vision-related on Intel® platforms.

Pyinstaller issue with Openvino 2021.2.185

MCC
Beginner
660 Views
 

I was unable to use pyinstaller to build executable exe. 

Below is my test python code.

from openvino.inference_engine import IECore
plugin = IECore()
model_xml = 'test.xml'
model_bin = 'test.bin'

net = plugin.read_network(model=model_xml, weights=model_bin)
exec_net = plugin.load_network(net, "CPU")
exec_net = plugin.load_network(net, "MYRIAD")

And I got the error below.

File "openvino\inference_engine\__init__.py", line 1, in <module>
File "ie_api.pyx", line 24, in init openvino.inference_engine.ie_api
ModuleNotFoundError: No module named 'openvino.inference_engine.constants'
[11956] Failed to execute script t2

And I used the below cmd to build exe.

python -m PyInstaller --add-data "C:\Program Files (x86)\Intel\openvino_2021.2.185\deployment_tools\inference_engine\bin\intel64\Release\plugins.xml;."^ --add-data "C:\Program Files (x86)\Intel\openvino_2021.2.185\deployment_tools\inference_engine\bin\intel64\Release\MKLDNNPlugin.dll;." --add-data "C:\Program Files (x86)\Intel\openvino_2021.2.185\deployment_tools\inference_engine\bin\intel64\Release\myriadPlugin.dll;."^ t2.py

 

Below is my environment:

OS: Both Windows 10 

Python Version : 3.6.8

Pyinstaller Version : 4.1

Openvino Version : openvino_2021.2.185

 

0 Kudos
8 Replies
Adli
Moderator
643 Views

Hi MCC,

 

Thank you for reaching out to us. If possible, could you share your reason for using pyinstaller to build an executable file?

Did you build the OpenVINO toolkit from the GitHub page

 

Regards,

Adli

 

MCC
Beginner
635 Views

Hi Adli,

build the OpenVINO toolkit by the installer.

The original development envirnment is python ,  this one required to run on the different platforms.

Pyinstaller is a way to create executable file in the Windows platform without install python.  

 

Regards,

MCC

Adli
Moderator
625 Views

Hi MCC,


I am going to reproduce this case on my side. Are there any files that you would like to share that could help this investigation?


Regards,

Adli


MCC
Beginner
607 Views

Hi Adli,

Unfortunately, I do not know which files are valuable.

 

Regards,

MCC

 

 

 

Adli
Moderator
601 Views

Hi MCC,


Thank you for your prompt response. Currently, we are investigating this issue and will get back to you soon.


Regards,

Adli


Adli
Moderator
574 Views

Hi MCC,

 

Thank you for your patience. It is not possible to convert an OpenVINO python demo/sample using Pyinstaller. This is due to the OpenVINO path/environment issue.

 

Regards,

Adli


Munesh_Intel
Moderator
560 Views

Hi MCC,

PyInstaller is not officially supported by OpenVINO. However, some of our Community members have successfully created the executable file using PyInstaller. I share the following cases with you here:

https://community.intel.com/t5/Intel-Distribution-of-OpenVINO/Are-pyinstaller-and-openvino-incompati...

 

https://community.intel.com/t5/Intel-Distribution-of-OpenVINO/Exe-built-using-OpenVino-and-pyinstall...

 

Please also refer to the following link for information on solving the ‘No module’ error.

https://stackoverflow.com/questions/58264381/python-importerror-openvino-by-script-and-by-shell

 

Regards,

Munesh


Munesh_Intel
Moderator
538 Views

Hi MCC,

This thread will no longer be monitored since we have provided examples and references. If you need any additional information from Intel, please submit a new question.


Regards,

Munesh


Reply