Error when using the inflect package

245 views
Skip to first unread message

Richie Mills

unread,
Jun 1, 2024, 9:36:50 AM6/1/24
to PyInstaller
Minimal working example (test_code.py):

import inflect
print(inflect.engine().number_to_words(6))

Python_Execution.png

System info:
PyInstaller: 6.7.0, contrib hooks: 2024.6
Python: 3.12.3
Platform: Windows 11 Pro 23H2

When test_code.exe is run, I get the following error message:
Traceback (most recent call last):
  File "test_code.py", line 1, in <module>
  File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
  File "PyInstaller\loader\pyimod02_importers.py", line 419, in exec_module
  File "inflect\__init__.py", line 2043, in <module>
  File "inflect\__init__.py", line 2064, in engine
  File "typeguard\_decorators.py", line 223, in typechecked
  File "typeguard\_decorators.py", line 71, in instrument
  File "inspect.py", line 1278, in getsource
  File "inspect.py", line 1260, in getsourcelines
  File "inspect.py", line 1089, in findsource
OSError: could not get source code
[7008] Failed to execute script 'test_code' due to unhandled exception!

EXE_Execution.png

warn-test_code.txt:
missing module named _frozen_importlib_external - imported by importlib._bootstrap (delayed), importlib (optional), importlib.abc (optional), zipimport (top-level)
excluded module named _frozen_importlib - imported by importlib (optional), importlib.abc (optional), zipimport (top-level)

Any thoughts would be very much appreciated!

Thank You!
Richie

Brenainn Woodsend

unread,
Jun 1, 2024, 2:07:12 PM6/1/24
to pyins...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages