Creating an executable with pyinstaller results in an error: "ModuleNotFoundError: No module named '<module>'‏

31 views
Skip to first unread message

Ziv Lang

unread,
Jun 12, 2022, 10:44:06 AM6/12/22
to PyInstaller
Hello.
I'm facing an issue when trying to open the executable that I created with pyinstaller.

The main script imports the other one as follows:

from file_2 import function_name.

Both files are in the same directory. This import apparently causes the issue. I tried adding flags: --hidden-import <file_2> and before that --paths <file_2> , and got the same result.
The basic command was: python

pyinstaller --onefile file_1.py

, to which I added flags.

Can you see where the issue is?

Thanks!

Reply all
Reply to author
Forward
0 new messages