Intel® Distribution of OpenVINO™ Toolkit
Community assistance about the Intel® Distribution of OpenVINO™ toolkit, OpenCV, and all aspects of computer vision-related on Intel® platforms.
6404 Discussions

Pyinstaller issue with Openvino 2021.2.185

MCC
Beginner
2,121 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
2,104 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

 

0 Kudos
MCC
Beginner
2,096 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

0 Kudos
Adli
Moderator
2,086 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


0 Kudos
MCC
Beginner
2,068 Views

Hi Adli,

Unfortunately, I do not know which files are valuable.

 

Regards,

MCC

 

 

 

0 Kudos
Adli
Moderator
2,062 Views

Hi MCC,


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


Regards,

Adli


0 Kudos
Adli
Moderator
2,035 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


0 Kudos
Munesh_Intel
Moderator
2,021 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-incompatible/td-p/1168565

 

https://community.intel.com/t5/Intel-Distribution-of-OpenVINO/Exe-built-using-OpenVino-and-pyinstaller-does-not-work-with-R3/m-p/1188030

 

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


0 Kudos
Munesh_Intel
Moderator
1,999 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


0 Kudos
Reply