New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pkg_resources relies on an internal implementation detail of CPython #378

bb-migration opened this Issue May 2, 2015 · 3 comments


None yet
2 participants

bb-migration commented May 2, 2015

Originally reported by: ericsnowcurrently (Bitbucket: ericsnowcurrently, GitHub: ericsnowcurrently)


Apparently pkg_resources is importing importlib._bootstrap, which is not meant to be directly imported. It is used later to get SourceFileLoader and FileFinder. I noticed this due to a failing test (test_venv) in the CPython suite when I moved both those classes to a different file (no longer in See

Starting in Python 3.3 the two classes are exposed in importlib.machinery. I'd recommend updating the code to look something like this:

if sys.version_info >= (3, 3) and == "cpython":
    from importlib.machinery import SourceFileLoader, FileFinder
    SourceFileLoader = FileFinder = None

and update the rest of the file (3 spots) accordingly.


This comment has been minimized.

bb-migration commented May 28, 2015

Original comment by arfrever (Bitbucket: arfrever, GitHub: arfrever):

Fixed in 6f91e08f283f1822c16b4bafdee73cd30da56794.


This comment has been minimized.

bb-migration commented May 28, 2015

Original comment by ericsnowcurrently (Bitbucket: ericsnowcurrently, GitHub: ericsnowcurrently):



This comment has been minimized.


jayvdb commented Feb 16, 2017

This was fixed in 75d108c , and as far as I can tell, that means 17.0 is the first version of setuptools which works on Python 3.6.

takluyver added a commit to takluyver/pip that referenced this issue Apr 13, 2017

Include newer setuptools for tests
Old version of setuptools it was using had a bug on Python 3.6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment