Trouble converting a .py file to an exe file on the Jetson Nano

I’m unable to convert a .py file to an exe file on the Jetson Nano using the PyInstaller.

I get an error: Failed to execute script due to unhandled exception.

Is memory an issue?


Do you use OpenCV in the Python script?
If yes, please check the below doc:


Downgrading Pyinstaller and ran the two steps since I’m using Opencv in the .py script but it didn’t help. Is the fact that the total memory being consumed a hindrance for the exe file generation?

Also, how do I clear cache memory on the jetson nano?



The device has more than half memory (used 1.4G over 3.9G) so it should be good.
Do you see any error message when creating or does it just get stuck when converting?

The conversion might take time to finish. Please wait for it longer.


In the image, it’s shown cached memory of 2.4Gb and free memory of 71.4M. Does this mean only 71.4M is available out of the 3.9Gb?

Yes, I do get an error.

'I’ve installed Pyinstaller 4.2 and to create an exe file I first run the command:
pyinstaller --onefile

This command returns INFO: Building EXE from EXE-00.toc completed successfully.
I then cd into the dist directory and run the command:

This returns an error below:

Traceback (most recent call last):
  File "", line 1, in <module>
  File "PyInstaller/loader/", line 531, in exec_module
  File "cv2/", line 181, in <module>
  File "cv2/", line 111, in bootstrap
  File "cv2/", line 109, in load_first_config
ImportError: OpenCV loader: missing configuration file: ['']. Check OpenCV installation.
[10795] Failed to execute script align_stop

How do I fix this? @AastaLLL



Most are occupied by cache. Real usage is around 1.4G and should be good.

INFO: Building EXE from EXE-00.toc completed successfully.

Based on the output, the binary is successfully built.
But meet some environment-related issues when executing the binary.

This should be more related to the binary binding process.
Please make sure you have added all the required lib when wrapping the exe.


1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.