解决pip安装中Could not find a version that satisfies the requirement cv2 (from versions none)和权限不足等问题

一、问题

命令执行错误

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.1 命令

//--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

配置使用C盘python311

在这里插入图片描述
在这里插入图片描述

2.3 解决权限不足

如果碰到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重新执行命令
在这里插入图片描述

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值