python程序的cv2报错及解决


记一次Python中import cv2跟numpy报红报错解决方法


一般import后边报红都是因为没有module,用pip install cv2下载module,会出现  
Could not find a version that satisfies the requirement cv2 (from versions: )
No matching distribution found for cv2

You are using pip version 18.1, however version 19.0.2 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.

这时需要输入 python -m pip install --upgrade pip
等完成安装后,运行这句 “pip install opencv-python”,这句是安装cv2的module的,等下载完后就好了
安装numpy的module只需要 pip install numpy

汇总下,
    1、python -m pip install --upgrade pip
    2、pip install opencv-python
    3、pip install numpy

你可能感兴趣的:(python包的导入)