I encountered the same error and found a simple solution! The cv2.face command is dependent on the version of OpenCV you are running. It seems the version I am on (and the one you are probably running) uses a slightly different syntax for the command than the one that is being executed by ResourceSpace's python script. I suggest you launch python and review the OpenCV help page to find the proper one. Within Python, here is what I executed:
Python #launches Python command line
import cv2 #imports OpenCV library
print(help(cv2.face)) #prints OpenCV documentation
Scroll down to the command you are looking for. Once you have it, back up the faceRecognizerTrainer.py and faceRecognizer.py scripts and search/replace the old command with the one that works with your version of OpenCV.
I am now able to run the trainer. However, the tool does not recognize any faces from within ResourceSpace. When I select a face from within the interface, I receive the following error:
Error: Internal Server Error
ResourceSpace was not able to predict a label.
Maybe you will have better luck and report back in this thread!
Best,
Ian