0

I am using anaconda for my environments and when I try to export my program to a .exe it works but the exe fails and outputs the following error:

Traceback (most recent call last):
  File "importlib\metadata\__init__.py", line 397, in from_name
StopIteration

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "main.py", line 3, in <module>
  File "PyInstaller\loader\pyimod02_importers.py", line 378, in exec_module
  File "inquirer\__init__.py", line 1, in <module>
  File "PyInstaller\loader\pyimod02_importers.py", line 378, in exec_module
  File "inquirer\prompt.py", line 2, in <module>
  File "PyInstaller\loader\pyimod02_importers.py", line 378, in exec_module
  File "inquirer\render\__init__.py", line 1, in <module>
  File "PyInstaller\loader\pyimod02_importers.py", line 378, in exec_module
  File "inquirer\render\console\__init__.py", line 6, in <module>
  File "PyInstaller\loader\pyimod02_importers.py", line 378, in exec_module
  File "inquirer\events.py", line 1, in <module>
  File "PyInstaller\loader\pyimod02_importers.py", line 378, in exec_module
  File "readchar\__init__.py", line 6, in <module>
  File "importlib\metadata\__init__.py", line 889, in version
  File "importlib\metadata\__init__.py", line 862, in distribution
  File "importlib\metadata\__init__.py", line 399, in from_name
importlib.metadata.PackageNotFoundError: No package metadata was found for readchar
[PYI-11536:ERROR] Failed to execute script 'main' due to unhandled exception!

but when I use the same terminal instance to run main.py (the file i used pyinstaller on) the program runs perfectly

I have tried to reinstall pyinstaller with the conda install command. I have used one file and one dir but it hasn't worked

EDIT: I am importing the following moduals in main.py: inquirer os math time and 3 other files that I made The only other file that imports anything imports numpy

EDIT 2: I figured 1 thing out, it happens whenever I import a modual in a script, pyinstaller creates an EXE that doesn't work with imports

1
  • What imports are you bringing into this program? Here is a similar issue where pyinstaller was the problem.
    – MUFF.
    Commented Sep 5 at 16:54

0

Browse other questions tagged or ask your own question.