Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Bug]: Crashes trying to use QtAgg backend #23131

Closed as not planned
Closed as not planned
@davidgilbertson

Description

@davidgilbertson

Bug summary

I tried doingpip install pyside6 and using matplotlib and a chart window appears, but just hangs.

Code for reproduction

importmatplotlibasmplimportmatplotlib.pyplotaspltmpl.use('QtAgg')# 'QT5Agg' also fails, 'TkAgg' works.plt.plot([1,2,3,2,3,4])plt.show()

Actual outcome

Chart window opens and hangs.

image

Expected outcome

Should work the same as when the backend isTkAgg.

Additional information

I'm running the code in IntelliJ and everything worked fine before I installed Qt.

I'm a newbie and a bit confused as to what exactly I need to do to use Qt as a backend. Note that I'm just exploring/learning, I don't have areason to want to use Qt over Tk or anything else.

I've readthis page on Qt bindings (the text on this page doesn't show up in the actual docs)

And also saw#19255 that seems to add support and was merged and I'm using a later version3.5.2.

And I've readthis page in the docs and it seems to imply (but not say) that all I need to do is install PySide6 and it should work.

Weirdly, if I just use the code:

importmatplotlib.pyplotaspltplt.plot([1,2,3,2,3,4])plt.show()

It works, which is weird for two reasons:

  1. This means that justimporting matplotlib invokes different behaviour to importingmatplotlib.pyplot.
  2. Not importing matplotlib directly (onlypyplot) results in the message "Backend MacOSX is interactive backend. Turning interactive mode on.". Weird as I'm on Windows, and if I then runplt.get_backend() it saysQtAgg. It's all so confusing!

Operating system

Windows 11

Matplotlib Version

3.5.2

Matplotlib Backend

QtAgg, Qt5Agg

Python version

3.10.2

Jupyter version

No response

Installation

pip

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp