我的Python程序有问题。在IDE(spyder IDE)上运行该程序时,没有出现错误,并且运行良好。否则,如果我在python IDLE中运行它,则会收到以下错误。
RESTART: C:\Users\jeane\Documents\Cours\BSP sem2\TechnicalPart\CNNLuminosity\Serverside\finalCnnOutput.py
Using TensorFlow backend.
Traceback (most recent call last):
File "C:\Users\jeane\Documents\Cours\BSP sem2\TechnicalPart\CNNLuminosity\Serverside\finalCnnOutput.py", line 43, in <module>
test_image = image.load_img('blab-cam' + str(i) + '-snapshots/gallery-images/latest.png', target_size = (64,64))
File "C:\Users\jeane\AppData\Local\Programs\Python\Python36\lib\site-packages\keras_preprocessing\image\utils.py", line 108, in load_img
raise ImportError('Could not import PIL.Image. '
ImportError: Could not import PIL.Image. The use of `load_img` requires PIL.
我认为该错误与Python路径环境变量有关,因为我找不到该模块。