You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After installing matplotlib, import importlib causes importlib.machinery to be available.
Before installing matplotlib (or after uninstalling it), import importlib.machinery is necessary to access the machinery module.
This may seem benign (after all, I'm not saying matplotlib breaks importlib) but I lost a chunk of time tracing down the source of the inconsistency. I can't see any reason why this package should change importlib's behavior.
Code for reproduction
Expected behavior
$ python -c 'import importlib; print(importlib.machinery)'
Traceback (most recent call last):
File "<string>", line 1, in<module>
AttributeError: module 'importlib' has no attribute 'machinery'
Actual behavior
$ pip install matplotlib
Looking in indexes: https://pypi.org/simple
Collecting matplotlib
Using cached matplotlib-3.3.4-cp38-cp38-manylinux1_x86_64.whl (11.6 MB)
...
Successfully installed matplotlib-3.3.4
$ python -c 'import importlib; print(importlib.machinery)'
<module 'importlib.machinery' from '/opt/python/Python-3.8.1/Lib/importlib/machinery.py'>
Matplotlib version
Operating system: confirmed on linux (ubuntu 14.04, 18.04) and macos 10.15
Matplotlib version: 3.3.4
Python version: 3.8.6
The text was updated successfully, but these errors were encountered:
Presumably, this is a side effect of a namespace package existing. I guess we can call this a bug in importlib, but in either case, there is a thought to remove the namespace package, so closing for #5327.
Uh oh!
There was an error while loading. Please reload this page.
Bug report
After installing matplotlib,
import importlib
causesimportlib.machinery
to be available.Before installing matplotlib (or after uninstalling it),
import importlib.machinery
is necessary to access themachinery
module.This may seem benign (after all, I'm not saying matplotlib breaks importlib) but I lost a chunk of time tracing down the source of the inconsistency. I can't see any reason why this package should change importlib's behavior.
Code for reproduction
Expected behavior
Actual behavior
Matplotlib version
The text was updated successfully, but these errors were encountered: