1. Problem
Command execution error
pip install opencv-python
pip install cv2 --trusted-host pypi.tuna.tsinghua.edu.cn
pip install cv2 --default-timeout=100 -i https://pypi.tuna.tsinghua.edu.cn/simple
2. Solve
2.1 Commands
//--trusted-host pypi.tuna.tsinghua.edu.cn 表示信任该站点,忽略警告
//--default-timeout=100 -i https://pypi.tuna.tsinghua.edu.cn/simple 解决no matching distribution found for XXX
pip install opencv-python --trusted-host pypi.tuna.tsinghua.edu.cn --default-timeout=100 -i https://pypi.tuna.tsinghua.edu.cn/simple
//如果碰到ERROR: Could not install packages due to an OSError: [WinError 5] 拒绝访问。: 'C:\\Python311\\share'Consider using the `--user` option or check the permissions.
//就在命令后面加上参数 --user或者用管理员方式打开cmd重新执行命令
2.2 install package
Configure to use C drive python311
2.3 Solving insufficient permissions
If you encounter ERROR: Could not install packages due to an OSError: [WinError 5] Access is denied. : 'C:\Python311\share'Consider using the --user
option or check the permissions. Just add the parameter --user
after the command or open cmd in administrator mode and re-execute the command