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] pip install picamera2 ignores NOGUI flag #184

Closed
magsol opened this issue Jun 28, 2022 · 9 comments
Closed

[BUG] pip install picamera2 ignores NOGUI flag #184

magsol opened this issue Jun 28, 2022 · 9 comments

Comments

@magsol
Copy link

magsol commented Jun 28, 2022

Describe the bug
When trying to install picamera2 via pip without GUI components, I entered the command exactly as indicated in the instructions:

NOGUI=1 pip install picamera2

but the procedure still tries to install PyQt5, which results in the entire process hanging and being killed by the OS.

Collecting PyQt5
  Using cached PyQt5-5.15.7.tar.gz (3.2 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... \ Killed

which means picamera2 is never installed.

To Reproduce
See above.

Expected behaviour
I'd expect PyQt5 not to be installed at all, given the presence of the NOGUI=1 flag.

Console Output, Screenshots
Screen Shot 2022-06-28 at 2 28 19 PM

Hardware :
I am using a Raspberry Pi 3B+ with a Camera Module V2 NoIR attached. I'm running Debian GNU/Linux 11 (bullseye) aarch64.

Additional context
I don't know if this is relevant, but you'll notice from the screenshot that I have set up a conda/mamba environment (micromamba, specifically). The only relevant packages installed via conda that are being used in the picamera2 installation process are python, pip, and numpy; everything else was pip or apt installed as per the instructions. I don't know if this could potentially cause conflicts--the one in particular I'm concerned with is the fact that OpenCV was installed via apt, but can be imported in the base environment without issues--but I don't really see how it would cause the wheels to ignore the NOGUI flag.

I saw that #124 seemed to have done exactly this in making PyQt optional, but I can't seem to get that behavior to work.

@magsol
Copy link
Author

magsol commented Jun 28, 2022

(best guess on why the process is being killed: out of memory)

@d-weber
Copy link

d-weber commented Jun 28, 2022

Same here, did try to install pyqt5 alone but no luck, it ran out of memory on RPI 4

@magsol
Copy link
Author

magsol commented Jun 28, 2022

@d-weber Same and same. Would love to bypass PyQt altogether.

@magsol
Copy link
Author

magsol commented Jun 29, 2022

This makes absolutely no sense to me considering this line seems to evaluate the NOGUI variable correctly https://github.com/raspberrypi/picamera2/blob/main/setup.py#L12

> export NOGUI="1"
> python -c "import os; print(os.getenv('NOGUI', '0') == '1');"
True

but then I run

> NOGUI=1 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.2.2-py3-none-any.whl (50 kB)
Collecting PyQt5
  Using cached PyQt5-5.15.7.tar.gz (3.2 MB)

It shouldn't be picking up PyQt5, but it is.

@chrisruk
Copy link
Collaborator

Thanks for reporting this, which I can also replicate. I've had a look into it and it seems due to wheel files (.whl) not actually executing/containing the code from setup.py. I'll look into ways to fix this.

@jack-solomomo
Copy link

I think a quick way around this is to install the dependencies directly and then install picamera2 with the --no-deps pip flag. This is working for me (RPi4, raspberry pi os bullseye, connected via ssh and capturing images to file).

pip install PiDNG piexif pillow simplejpeg v4l2-python3 python-prctl
pip install --no-deps picamera2

@magsol
Copy link
Author

magsol commented Jun 30, 2022 via email

@UcefMountacer
Copy link

I think a quick way around this is to install the dependencies directly and then install picamera2 with the --no-deps pip flag. This is working for me (RPi4, raspberry pi os bullseye, connected via ssh and capturing images to file).

pip install PiDNG piexif pillow simplejpeg v4l2-python3 python-prctl
pip install --no-deps picamera2

thanks, this worked for no GUI installation

(Bullseye, RPI 4, 64 bits)

@davidplowman
Copy link
Collaborator

I've posted a new release of Picamera2 that by default does not install the "gui dependencies" (PyQt5 and pyopengl). If you do want them, either install them directly (for example sudo apt install -y python3-pyqt5 python3-opengl or use pip3 install picamera2[gui].

I think the resolves the issue raised here, but if anything else comes up please feel free to raise a new issue. Thanks!

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

6 participants