79441184

Date: 2025-02-15 08:39:39
Score: 3
Natty:
Report link

the problem here is about internal paths and files that iconipy can not reach,

this is the error :

C:\Users\moham\Desktop\mine\stack\Final_exe_file\exe>test.exe
Traceback (most recent call last):
  File "test.py", line 48, in <module>
  File "test.py", line 42, in Get_Button_Icon
  File "test.py", line 25, in Get_CTk_Icon
  File "test.py", line 11, in Create_Icon
  File "iconipy\iconipy.py", line 259, in __init__
  File "iconipy\iconipy.py", line 419, in _get_icon_set_version
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\moham\\AppData\\Local\\Temp\\_MEI73962\\iconipy\\assets\\lucide\\version.txt'
[PYI-5844:ERROR] Failed to execute script 'test' due to unhandled exception!

is says the iconipy can not reach the file version.txt.

FileNotFoundError: [Errno 2] No such file or directory: 'C:\Users\moham\AppData\Local\Temp\_MEI73962\iconipy\assets\lucide\version.txt'

Why?

because pyinstaller did not put everything inside the library to your exe application.

so pyinstaller did not add the internal file version.txt to your exe internal files, and because of that this error appears.

how to solve it ?

to solve this problem you have to add the entire library yourself, as an additional folder to your exe application.

and this will force pyinstaller to add the entire library to your exe.

after that, the library will find the intended file.

how to do it ?

do this command in your terminal:

pyinstaller --noconfirm --onefile --console --add-data "C:\Python3-12-8\Lib\site-packages\iconipy;iconipy/" "C:\Users\moham\Desktop\mine\stack\test.py"

replace the paths with your paths, and this will make it work.

the application is running now

Reasons:
  • Blacklisted phrase (0.5): Why?
  • Blacklisted phrase (1): how to solve
  • RegEx Blacklisted phrase (1.5): how to solve it ?
  • Long answer (-1):
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • Low reputation (1):
Posted by: Mohammed Almalki