Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] "pip3 install picamera2" installs WITH PyQt5 bindings #1152

Open
neuron-whisperer opened this issue Nov 1, 2024 · 2 comments
Open

Comments

@neuron-whisperer
Copy link

Please only report one bug per issue!

Describe the bug

Installing picamera2 installs PyQt5, contrary to the instructions.

To Reproduce

python -m pip install picamera2 or some variant thereof.

Expected behaviour

The install instructions read as follows:

This is no longer the recommended way to install Picamera2. However, if you want to do so you can use ...

pip3 install picamera2[gui]

...which will install Picamera2 with all the GUI (Qt and OpenGL) dependencies. If you do not want these, please use ...

pip3 install picamera2

I am trying to install this package on a Raspberry Pi 5 running 64-bit Bookworm Lite without any windowed GUI. I installed Python 3.8.19 via pyenv (since I intend to run pygame), upgraded the OS and pip, and then found that picamera2 is not available. I followed the apt install instructions, which succeeded, but picamera2 was still not available in Python. So I tried following the above instructions to install picamera2 without GUI stuff, and it did this:

$ python -m pip install picamera2
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting picamera2
  Using cached https://www.piwheels.org/simple/picamera2/picamera2-0.1.1-py3-none-any.whl (42 kB)
Requirement already satisfied: numpy in ./.pyenv/versions/3.8.19/lib/python3.8/site-packages (from picamera2) (1.24.4)
Collecting PiDNG (from picamera2)
  Using cached pidng-4.0.9.tar.gz (21 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Collecting piexif (from picamera2)
  Using cached https://www.piwheels.org/simple/piexif/piexif-1.1.3-py2.py3-none-any.whl (20 kB)
Collecting pillow (from picamera2)
  Using cached pillow-10.4.0-cp38-cp38-manylinux_2_28_aarch64.whl.metadata (9.2 kB)
Collecting pyopengl (from picamera2)
  Using cached https://www.piwheels.org/simple/pyopengl/PyOpenGL-3.1.7-py3-none-any.whl (2.4 MB)
Collecting PyQt5 (from picamera2)
  Using cached PyQt5-5.15.11.tar.gz (3.2 MB)

...which is clearly installing PyQt5 contrary to the install instructions.

Console Output, Screenshots

See above.

Hardware :

Raspberry Pi 5 8GB with Raspberry Pi Camera Module 3 connected.

Additional context

n/a

@mgineer85
Copy link

Hey, I think best would be to use the venv as you were trying earlier but allow the venv access to the system packages:
https://docs.python.org/3/library/venv.html#creating-virtual-environments
Check out the --system-site-packages flag.

If you plan using numpy in your venv you might need to pin the last v1 numpy version. If you need numpy >2, also install simplejpeg in your venv as the system packages are quite outdated and saving images with picamera2 fails otherwise.

Maybe this could be addressed by updating the system packages in the OS in the future?

@neuron-whisperer
Copy link
Author

neuron-whisperer commented Nov 14, 2024

I don't use venv in these circumstances because it's a Raspberry Pi running a single application in a kiosk context. My install script installs pyenv and a specific version of Python (3.8.19), and the device runs one script in that one Python environment... The End. The device does nothing else, not even run a windowed GUI (hence Raspberry Pi OS Lite), so a virtual environment for the script isn't required.

I tried again, first installing simplejpeg and then again running python -m pip install picamera2 to install picamera2 without PyQt. Same result: picamera2-0.1.1-py3-none-any.whl requires PyQT5, which is directly contrary to the install instructions.

There is a clear disconnect between what the picamera2 install instructions state about the requirements of the picamera2 package and the actual requirements of the picamera2 package at piwheels. Please address this, either by fixing the dependencies in the install package or by correcting the install instructions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants