安装好后dlib,pycharm依旧报错没有dlib模板

用whl文件安装了dlib库,可是pycharm里import dlib报错没有名为dlib的模块

用代码块功能插入代码,请勿粘贴截图
import dlib
from PIL import Image
model = load_model('mask_and_nomask.h5')
detector = dlib.get_frontal_face_detector()
video=cv2.VideoCapture(0)
font = cv2.FONT_HERSHEY_SIMPLEX
def rec(img):
    gray=cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)
    dets=detector(gray,1)
    if dets is not None:
        for face in dets:
            left=face.left()
            top=face.top()
            right=face.right()
            bottom=face.bottom()
            cv2.rectangle(img,(left,top),(right,bottom),(0,255,0),2)
            img1=cv2.resize(img[top:bottom,left:right],dsize=(150,150))
            img1=cv2.cvtColor(img1,cv2.COLOR_BGR2RGB)
            img1 = np.array(img1)/255.
            img_tensor = img1.reshape(-1,150,150,3)
            prediction =model.predict(img_tensor)
            print(prediction)
            if prediction[0][0]>0.5:
                result='nomask'
            else:
                result='mask'
            cv2.putText(img, result, (left,top), font, 2, (0, 255, 0), 2, cv2.LINE_AA)
        cv2.imshow('mask detector', img)
while video.isOpened():
    res, img_rd = video.read()
    if not res:
        break
    rec(img_rd)
    if cv2.waitKey(1) & 0xFF == ord('q'):
        break
video.release()
cv2.destroyAllWindows()


运行结果及报错内容

img

我的解答思路和尝试过的方法

用cmd命令行安装了cmake,boost,dlib
下载whl文件到Anaconda/Scripts后cmd命令行安装,显示安装成功,但还是报错没有dlib模板
从设置里的python解释器找,只找到r-dlib,安装后,依旧报错

我想要达到的结果

哪位同志帮我看看问题出在哪里,为什么一直说没有dlib模板

在pycahrm代码中,鼠标放到你的爆红的dlib上,然后安ctrl+enter 安装一下就行了

已经解决了
因为我的项目是在虚拟环境中,所以我是在Anaconda Prompt里输入conda activate 虚拟环境名 再conda install 安装包名,,我的安装包是从https://anaconda.org中搜出来,在其他地方找的好像都用不了