Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at

Bug 1958886

Summary: python-matplotlib fails to build with Python 3.10: ImportWarning: gi.importer.DynamicImporter.find_spec() not found; falling back to find_module() (treated as error in tests)
Product: [Fedora] Fedora Reporter: Miro Hrončok <mhroncok>
Component: python-matplotlibAssignee: Elliott Sales de Andrade <quantum.analyst>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: unspecified    
Version: rawhideCC: gwync, jonathan.underwood, mhroncok,, python-sig, quantum.analyst, thibault, thrnciar, tomspur
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-06-04 20:28:56 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On: 1958890    
Bug Blocks: 1890881    

Description Miro Hrončok 2021-05-10 11:29:20 UTC
python-matplotlib fails to build with Python 3.10.0b1.

__________________________________ test_fork ___________________________________
[gw0] linux -- Python 3.10.0 /usr/bin/python3

name = '_winapi', path = None, target = None

>   ???
E   AttributeError: 'DynamicImporter' object has no attribute 'find_spec'

<frozen importlib._bootstrap>:939: AttributeError

During handling of the above exception, another exception occurred:

    @pytest.mark.skipif(not hasattr(os, "register_at_fork"),
                        reason="Cannot register at_fork handlers")
    def test_fork():
        _model_handler(0)  # Make sure the font cache is filled.
        ctx = multiprocessing.get_context("fork")
>       with ctx.Pool(processes=2) as pool:

_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/lib64/python3.10/multiprocessing/ in Pool
    from .pool import Pool
/usr/lib64/python3.10/multiprocessing/ in <module>
    from .connection import wait
/usr/lib64/python3.10/multiprocessing/ in <module>
    import _winapi
<frozen importlib._bootstrap>:1027: in _find_and_load
<frozen importlib._bootstrap>:1002: in _find_and_load_unlocked
<frozen importlib._bootstrap>:941: in _find_spec
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

finder = <gi.importer.DynamicImporter object at 0x7f1f229569e0>
name = '_winapi', path = None

>   ???
E   ImportWarning: DynamicImporter.find_spec() not found; falling back to find_module()

<frozen importlib._bootstrap>:914: ImportWarning
FAILED - ImportWarning: DynamicImporter.find_...
FAILED - ImportWarning: DynamicImporter....
FAILED - ImportWarning: DynamicImporter.fin...
FAILED - ImportWarning: DynamicImporter.find_spec...
= 4 failed, 7858 passed, 181 skipped, 13 xfailed, 5 xpassed in 608.08s (0:10:08) =

This problematic code is in pygobject, but matplotlib might be fixed by not treating this warning as error.

"""Starting in this release, there will be a concerted effort to begin cleaning up old import semantics that were kept for Python 2.7 compatibility. Specifically, find_loader()/find_module() (superseded by find_spec()), load_module() (superseded by exec_module()), module_repr() (which the import system takes care of for you), the __package__ attribute (superseded by __spec__.parent), the __loader__ attribute (superseded by __spec__.loader), and the __cached__ attribute (superseded by __spec__.cached) will slowly be removed (as well as other classes and methods in importlib). ImportWarning and/or DeprecationWarning will be raised as appropriate to help identify code which needs updating during this transition."""

For the build logs, see:

For all our attempts to build python-matplotlib with Python 3.10, see:

Testing and mass rebuild of packages is happening in copr. You can follow these instructions to test locally in mock if your package builds with Python 3.10:

Let us know here if you have any questions.

Python 3.10 will be included in Fedora 35. To make that update smoother, we're building Fedora packages with early pre-releases of Python 3.10.
A build failure prevents us from testing all dependent packages (transitive [Build]Requires), so if this package is required a lot, it's important for us to get it fixed soon.
We'd appreciate help from the people who know this package best, but if you don't want to work on this now, let us know so we can try to work around it on our side.

Comment 1 Miro Hrončok 2021-06-04 20:13:12 UTC
This is a mass-posted update. Sorry if it is not 100% accurate to this bugzilla.

The Python 3.10 rebuild is in progress in a Koji side tag. If you manage to fix the problem, please commit the fix in the rawhide branch, but don't build the package in regular rawhide.

You can either build the package in the side tag, with:

    $ fedpkg build --target=f35-python

Or you can the build and we will eventually build it for you.

Note that the rebuild is still in progress, so not all (build) dependencies of this package might be available right away.


See also

If you have general questions about the rebuild, please use this mailing list thread:

Comment 2 Elliott Sales de Andrade 2021-06-04 20:28:56 UTC
Fixed by the linked bug report.