marcelotduarte/cx_Freeze

No module named 'pkg_resources.py2_warn' with setuptools 45.0.0

jpeg13 opened this issue · 3 comments

After building an application depending on pkg_resources, the executable fails with a ModuleNotFoundError: No module named 'pkg_resources.py2_warn' when using setuptools 45.0.0.

This can be reproduced e.g. by adding an import pkg_resources to the [simple sample].(https://github.com/anthony-tuininga/cx_Freeze/blob/master/cx_Freeze/samples/simple/hello.py)

Traceback:

C:\JP\80_Own_tools\tests\setuptools_45.0.0>build\exe.win-amd64-3.6\hello.exe
Traceback (most recent call last):
  File "c:\jp\98_bitbucket_sandboxes\github\cx_freeze\cx_Freeze\initscripts\__startup__.py", line 40, in run
    module.run()
  File "c:\jp\98_bitbucket_sandboxes\github\cx_freeze\cx_Freeze\initscripts\Console.py", line 37, in run
    exec(code, {'__name__': '__main__'})
  File "hello.py", line 7, in <module>
    import pkg_resources
  File "C:\JP\80_Own_tools\tests\setuptools_45.0.0\venv\lib\site-packages\pkg_resources\__init__.py", line 86, in <module>
    __import__('pkg_resources.py2_warn')
ModuleNotFoundError: No module named 'pkg_resources.py2_warn'

This works just fin with setuptools 44.0.0.

For the record, already submitted as #565

For the record, already submitted as #565

I missed that, sorry, I looked only at the issues. At least we come with similar solutions!

PR #584 solves the issue.