MagicMirror² v2.13.0 is available! For more information about this release, check out this topic.

"phyton" error

  • When I try to run “phyton” I have the next error:

    pi@raspberrypi:~/MagicMirror/modules/MMM-Facial-Recognition-Tools-master/facetrainer $ python
    What do you want to do?
    [1] Capture training images from webcam
    [2] Convert ‘*.jpg’ pictures from other cameras to training images
    –> 1

    Enter the name of the person you want to capture or convert images for.
    –> c
    Images will be placed in ./training_data/c

    Starting process…

    Capturing positive training images.
    Type c (and press enter) to capture an image.
    Press Ctrl-C to quit.
    Capturing image…
    mmal: mmal_vc_component_create: failed to create component ‘’ (1:ENOMEM)
    mmal: mmal_component_create_core: could not create component ‘’ (1)
    Traceback (most recent call last):
    File “”, line 35, in
    File “/home/pi/MagicMirror/modules/MMM-Facial-Recognition-Tools-master/facetrainer/lib/”, line 55, in capture
    image =
    File “/home/pi/MagicMirror/modules/MMM-Facial-Recognition-Tools-master/facetrainer/lib/”, line 23, in read
    with picamera.PiCamera() as camera:
    File “/usr/lib/python2.7/dist-packages/picamera/”, line 488, in init
    self.STEREO_MODES[stereo_mode], stereo_decimate)
    File “/usr/lib/python2.7/dist-packages/picamera/”, line 526, in _init_camera
    "Camera is not enabled. Try running ‘sudo raspi-config’ "
    picamera.exc.PiCameraError: Camera is not enabled. Try running ‘sudo raspi-config’ and ensure that the camera has been enabled.

    But when I use the comand “fswebcam image.jpg” i can use without problem. Someone know what is happend?

  • Module Developer

    Did you try running sudo raspi-config and enabling the camera?

  • Hi, tranks for help in my problem. Yes, the Camara is enable on the raspi-config.

    I’m using an USB camara, was detected by the Raspberry and take pictures if I use “fswebcam image.jpg” command.

    Another problem is if use images that have to compilate the face-detection-trainer, it generate the negative of pics but not generate the xml file. What could be happens?


  • Moderator

    You said you’re using a USB camera, but that error tells me it’s wanting to access an rpi camera, one that gets connected to the on board camera port, not USB. You’re going to have to figure out how to change the code to use a USB camera instead.

  • I have the same problem! Does someone have the solution for this problem?
    I also use an USB camera on my raspberry pi, and get the same error!

  • @s1081314

    I had the same problem. Couldn’t capture using USB webcam. Read somewhere that it does not work with USB webcam. So i got around this by taking pics (fswebcam) and selecting option 2 and giving the path to where the images were saved. That worked without any issue.

    Read the post below…


Log in to reply