I recently bought a Raspberry Pi 3B+ and a Pi Noir Camera and attempted to set them up. I followed the install instructions on the Pi website for the board and camera, and unfortunately received an error when trying to run the camera preview script.
The error was as follows:
camera = picamera.PiCamera() mmal: mmal_vc_component_enable: failed to enable component : ENOSPC Traceback (most recent call last): File "<stdin>", line, in <module> ... ... picamera.exc.PiCameraMMALError: Camera component couldn't be enabled: Out of resources
I have verified that it is a software issue and not a hardware issue as I have tried setting up two different Pi boards and NOIR cameras.
I checked the connection of the camera to the pi board using vcngencmd get_camera. I then also attempted to substitute the camera module I had plugged in for a different one (as I bought two) and received the same error. I used the config utility to enable the camera and reboot the board after doing so.
I have also tried updating the packages, as recommmended in many previous forums, no dice.
Additionally, no manual changes were made to the /boot/config.txt and no other scripts are running. This is the first script to be run on the board. I have no other programs running or trying to access the camera as this was literally plugged in and set up straight out of the box.
Any help would be much appreciated. Thanks!