question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

setuptools 45.0.0 may cause PyInstaller 3.3 packaged executable fail to launch

See original GitHub issue

In my specific example where we use PyInstaller 3.3 to package our application into an executable for deployment, the resulting executable cannot be launched after setuptools was updated from 44.0.0 to 45.0.0. This happened right at 9:00PM Pacific Time yesterday.

The error signature is (when launching the executable generated by PyInstaller):

[1072] Failed to execute script pyi_rth_pkgres
Traceback (most recent call last):
  File "site-packages/PyInstaller/loader/rthooks/pyi_rth_pkgres.py", line 11, in <module>
  File "/<virtualenv-path>/lib/python3.6/site-packages/PyInstaller/loader/pyimod03_importers.py", line 631, in exec_module
    exec(bytecode, module.__dict__)
  File "site-packages/pkg_resources/__init__.py", line 86, in <module>
ModuleNotFoundError: No module named 'pkg_resources.py2_warn'

PyInstaller version is 3.3, setuptools is 45.0.0 Working just fine with setuptools 44.0.0

For certain limitations in our Python application, we are stuck with Pyinstaller 3.3, but we are definitely looking into using later versions of PyInstaller.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:45
  • Comments:39 (10 by maintainers)

github_iconTop GitHub Comments

106reactions
priitlattcommented, Jan 13, 2020

Observed the same behaviour on Python 3.7.5 with PyInstaller 3.5 and PyInstaller 3.6. I was able to build again successfully after reverting to previous release of setuptools:

pip install --upgrade 'setuptools<45.0.0'
33reactions
wedesoftcommented, Jan 14, 2020

Fixed by adding a hidden import:

a = Analysis(...,
             hiddenimports=['pkg_resources.py2_warn'],
             ...)
Read more comments on GitHub >

github_iconTop Results From Across the Web

Pyinstaller Error - "setuptools distribution was not found"
This is due to a package or set of files that are not being included in the final .exe file by PyInstaller. This...
Read more >
setuptools 5.0.1 - PyPI
Easily download, build, install, upgrade, and uninstall Python packages.
Read more >
Pyinstaller Executable Fails With Pkg_Resources ... - ADocLib
DistributionNotFound error when run and how do we fix it? ... setuptools 45.0.0 may cause PyInstaller 3.3 packaged executable fail to launch #1963....
Read more >
History - setuptools 65.6.3.post20221216 documentation
By default the users will experience a lenient behavior which prioritises the ability of the users of changing the distributed packages (e.g. adding...
Read more >
Problem z programem skomplikowanym poprzez PyInstaller - Forum ...
Dodam że po zaktualizowaniu PyInstaller'a z 3.6 do 4.0 problem nie ... setuptools 45.0.0 may cause PyInstaller 3.3 packaged executable fail to launch...
Read more >

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found