ModuleNotFoundError: No module named 'pkg_resources.py2_warn'

23 views
Skip to first unread message

ankit kumar

unread,
May 13, 2020, 3:42:36 AM5/13/20
to PyInstaller
Hi,
I am getting No module named 'pkg_resources.py2_warn' in pyinstaller when running the exe.
Things that I have tried:
                                   1. Updating the setuptools and pyinstaller (although I am already having the latest ones).
                                   2. Used try except block with pass to ignore exceptions in pyi_rth_pkgres.py and pyimod03_importers.py by taking the reference from one of the post from this forum.
                                   
What I assume is that if I comment out the import statement of dialogflow_v2 in my script it works fine otherwise if I run the exe with dialogflow_v2 import statement, I get below error:

                                                                                File "site-packages\PyInstaller\loader\rthooks\pyi_rth_pkgres.py", line 13, in <module>
                                                                                File "c:\users\ankit.bw.kumar\.conda\envs\envforpyqt\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 623, in exec_module
                                                                                exec(bytecode, module.__dict__)
                                                                                File "pkg_resources\__init__.py", line 86, in <module>
                                                                                ModuleNotFoundError: No module named 'pkg_resources.py2_warn'
                                                                                [17696] Failed to execute script pyi_rth_pkgres.

Thanks & Regards,
Ankit Kumar
Reply all
Reply to author
Forward
0 new messages