[OTHER] ImportError: cannot import name 'QGlPicamera2' from 'picamera2.previews.qt'

Open
#793 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
25/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
python
Domain
embedded-iot

Research direction

Start by reproducing the supplied example and inspect the picamera2.previews.qt entry point where QGlPicamera2 is imported. Check the installed Picamera2 environment and compare the available Qt preview symbols with the documentation example. Done means the example no longer raises this ImportError, with the required environment or documentation correction identified.

Written by the indexing model from the issue text.

Description

I'm receiving this error when attempting to access the camera. ImportError: cannot import name 'QGlPicamera2' from 'picamera2.previews.qt'

I tried using this example code straight from the Picamera2 docs and I received the same error as well.

from picamera2 import Picamera2, Preview
import time
picam2 = Picamera2()
camera_config = picam2.create_preview_configuration()
picam2.configure(camera_config)
picam2.start_preview(Preview.QTGL)
picam2.start()
time.sleep(2)
picam2.capture_file("test.jpg")

Any help on how I can resolve this would be appreciated.

Dominant language
Python
Stars
1.2k
Forks
258
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from raspberrypi/picamera2

All issues in raspberrypi/picamera2

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.