Skip to content

Incompatibility between setuptools and pyInstaller #2262

@thetheo2

Description

@thetheo2

We have a specific testcase as below.
The testcase passes at setuptools==49.0.1, PyInstaller==3.6, and fails at newer releases of setuptools as below--
./hello_world
Traceback (most recent call last):
File "hello_world.py", line 4, in
import pkg_resources.py2_warn
ModuleNotFoundError: No module named 'pkg_resources'
[7155] Failed to execute script hello_world

The hello_world.py script is as below--
import pkg_resources.py2_warn
print('hello world')
try :
    import numpy
    print(numpy.sqrt(2))
except (ImportError,AttributeError) :
    pass
try :
    import requests
    r = requests.get('https://api.github.com/repos/psf/requests')
    print(r.json()['description'])
except (ImportError,AttributeError) :
    pass

PyInstaller is run as below--
../../pp_src/invio/bin/pyinstaller --clean -d all -F hello_world.py

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions