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

Appearance settings

Embedding in PyQt #340

Copy link
Copy link
Closed
Closed
Copy link
@joeyo

Description

@joeyo
Issue body actions

Here is a minimal example example that should work with Qt:

import fastplotlib as fpl
plot = fpl.Plot(canvas="qt")
plot.show()

if __name__ == "__main__":
    fpl.run()

With these packages installed:

wgpu==0.11.0
pygfx==0.1.15
fastplotlib==0.1.0a13
PyQt6==6.5.3

the following error message is generated (similar errors occur with PyQt5, PySide2, and PySide6):

Traceback (most recent call last):
  File "/Users/joeyo/src/bmi/analysis/joeyo/fpl/qt_minimal.py", line 3, in <module>
    plot = fpl.Plot(canvas="qt")
  File "/opt/homebrew/lib/python3.10/site-packages/fastplotlib/layouts/_plot.py", line 54, in __init__
    super(Plot, self).__init__(
  File "/opt/homebrew/lib/python3.10/site-packages/fastplotlib/layouts/_subplot.py", line 77, in __init__
    canvas, renderer = make_canvas_and_renderer(canvas, renderer)
  File "/opt/homebrew/lib/python3.10/site-packages/fastplotlib/layouts/_utils.py", line 50, in make_canvas_and_renderer
    raise ImportError(
ImportError: The qt framework is not installed for using this canvas

Which suggests that fastplotlib/layouts/_utils.py:17 is raising an ImportError:

16 try:
17    from wgpu.gui.qt import QWgpuCanvas
18 except ImportError:
19    QWgpuCanvas = False

However the following will run without errors:

import PyQt6  # apparently necessary
from wgpu.gui.qt import QWgpuCanvas

Is there some missing import logic?

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

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.