去评论
海欣资源

解决ModuleNotFoundError: No module named ‘cv2‘等错误

ss8988
2022/04/22 21:30:20
鍦ㄥ畨瑁卭pevncv鏃朵細鍑虹幇ImportError: No module named cv2 鐨勯敊璇紝鎵句笉鍒癱v2鐨勫寘銆 杩欐椂鍊欏畨瑁呮墿灞曞寘鍗冲彲锛氭墦寮cmd杈撳叆锛歱ip install opencv-python
濡傛灉鍦ㄨ繍琛屽悗鍙堝嚭鐜版姤閿欙細
Requirement already satisfied: opencv-python in ./.local/lib/python3.6/site-packages (4.2.0.34)
Requirement already satisfied: numpy>=1.11.3 in ./anaconda3/lib/python3.6/site-packages (from opencv-python) (1.13.3)
鎴戞兂鎸塷pencv-python锛屾庝箞涔熷畨瑁呬笉涓婏紝鍘熸潵鏄畠榛樿璺緞宸茬粡涓嶅彉浜嗭紝涓嶆槸鍦ㄦ垜鐜板湪鐨勮櫄鎷熺幆澧冮噷锛屾墍浠ワ紝闇瑕佹寚瀹氳矾寰勶細
pip install --target=/home/xxxx/anaconda3/envs/huayan/lib/python3.6/site-packages opencv-python==4.2.0.34 -i https://pypi.doubanio.com/simple
鍚庨潰鐨-i xxx鏄寚瀹氫笅杞芥簮銆
杩欎竴姝ュ悇绉峂oduleNotFoundError: No module named 'XXXX鈥欒В鍐崇殑鏂规硶涓鏍
鏈鍚庢墦寮pycharm锛岃繘琛岀幆澧冮厤缃紝鍦╬ycharm涓畨瑁呬笂opencv锛

閫夋嫨濂介」鐩乸ython瑙i噴鍣ㄧ劧鍚庣偣鍑烩灂锛堝姞鍙凤級

鎼滅储opencv杩涜瀹夎