在cmd中输入命令:
pip install --upgrade setuptools
pip install numpy Matplotlib
pip install opencv-python
即可
网络原因报错的话需要重新设置源网址:
import os
ini="""[global]
index-url = https://pypi.doubanio.com/simple/
[install]
trusted-host=pypi.doubanio.com
"""
pippath=os.environ["USERPROFILE"]+"\\pip\\"
if not os.path.exists(pippath):
os.mkdir(pippath)
with open(pippath+"pip.ini","w+") as f:
f.write(ini)