AttributeError:部分初始化的模块'cv2'没有属性'imread'

时间:2020-07-08 19:14:39

标签: python opencv cv2 imread

直到1个小时后,我的opencv代码都运行良好。它可以正常运行我的脚本。但我不知道为什么突然回来会开始出现此错误:

public function isvalidateuser($email,$password)
    {
        $q = $this->db->where(['email'=>$email])
                    ->get('user');
                    $row = $q->row();
                    if (!is_null($row)){

                      if(password_verify($password,$row->password))
                      {
                       
                          return $q->row()->id;
                      
                      }

                      else
                      {
                          return false;
                      }
                   }
                    else{
                        return false;
                   } 
    }

那可能是什么错误?

更新:这是我的代码-

AttributeError: partially initialized module 'cv2' has no attribute 'imread' (most likely due to a circular import)
Traceback (most recent call last):
  File "FACEDETECTION.PY", line 1, in <module>
    import cv2
  File "C:\Users\Lenovo\anaconda3\envs\CAM\lib\site-packages\cv2\__init__.py", line 5, in <module>
    from .cv2 import *
ImportError: numpy.core.multiarray failed to import

0 个答案:

没有答案