[Bug]: macOS: PyPy 3.8 (v7.3.9) threading get_native_id Broken · Issue #24094 · matplotlib/matplotlib · GitHub
Skip to content

[Bug]: macOS: PyPy 3.8 (v7.3.9) threading get_native_id Broken #24094

Description

@ax3l

Bug summary

In PyPy 3.8 (v7.3.9), matplotlib 3.6.0 is cannot be imported, leading to breakage.

Ref.: https://foss.heptapod.net/pypy/pypy/-/issues/3764

Code for reproduction

import matplotlib.pyplot as plt

Actual outcome

AttributeError: module 'threading' has no attribute 'get_native_id'

in matplotlib/pyplot.py:337

     def _warn_if_gui_out_of_main_thread():
         # This compares native thread ids because even if python-level Thread
         # objects match, the underlying OS thread (which is what really matters)
         # may be different on Python implementations with green threads.
         if (_get_required_interactive_framework(_get_backend_mod()) and
 >               threading.get_native_id() != threading.main_thread().native_id):
 E               AttributeError: module 'threading' has no attribute 'get_native_id'

Expected outcome

Work as usual.

Additional information

This has been first posted in PyPy: https://foss.heptapod.net/pypy/pypy/-/issues/3764

I saw this on Conda-Forge, starting a few weeks ago as they shipped the latest PyPy 3.8.

Operating system

macOS 11.7 (x86_64) via Azure Pipelines 14 Runner

Matplotlib Version

3.6.0

Matplotlib Backend

default

Python version

PyPy 3.8 (v7.3.9)

Jupyter version

N/A

Installation

conda

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions