在pycharm中ImportError:DLL加载失败:找不到指定的模块。导入面部识别时

问题描述 投票:2回答:1

我在Pycharm中导入“face_recognition”时收到此错误,但它从“anaconda命令提示符”运行完全正常。我不明白为什么我在Pycharm中遇到错误而在Anaconda cmd中没有错误。我可以在Pycharm中成功导入cv2。有人能告诉我如何在pycharm中运行它?以下是完整的错误: -

Traceback (most recent call last):
File "C:/Users/r/PycharmProjects/Practise AI/check.py", line 1, in <module>
import face_recognition
File "C:\ProgramData\Anaconda3\lib\site- 
packages\face_recognition\__init__.py", line 7, in <module>
from .api import load_image_file, face_locations, batch_face_locations, 
face_landmarks, face_encodings, compare_faces, face_distance
File "C:\ProgramData\Anaconda3\lib\site-packages\face_recognition\api.py", line 3, in <module>
import PIL.Image
File "C:\ProgramData\Anaconda3\lib\site-packages\PIL\Image.py", line 64, in <module>
from . import _imaging as core
ImportError: DLL load failed: The specified module could not be found.
python python-3.x pycharm anaconda face-recognition
1个回答
0
投票

好吧,在pycharm设置中添加anaconda解释器后,它终于工作了。

enter image description here

© www.soinside.com 2019 - 2024. All rights reserved.