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?

Hi,

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

https://elinux.org/Jetson/L4T/TRT_Customized_Example#PyInstaller_with_OpenCV

Thanks.

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?

@AastaLLL

Hi,

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.

Thanks.

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 align_stop.py

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

This returns an error below:

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

How do I fix this? @AastaLLL

Hi,

image

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.

Thanks.

1 Like

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