解决pytest安装失败、python安装依赖报错Could not find a version that satisfies the requirement

文章描述了在安装pytest时遇到的问题,包括找不到满足要求的版本和pip的更新。解决方案包括以管理员权限打开CMD,使用python-mpipinstall--upgradepip命令更新pip,然后再次尝试安装pytest。通过这些步骤,最终成功安装pytest。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

解决pytest安装失败、python安装依赖报错Could not find a version that satisfies the requirement

使用命令 $ pip install pytest 安装pytest失败
报错信息:
ERROR: Could not find a version that satisfies the requirement pytest (from versions: none)
ERROR: No matching distribution found for pytest
WARNING: There was an error checking the latest version of pip.
在这里插入图片描述
尝试更换软件安装源,更改命令、pycharm安装均失败。
【三步解决】更新pip
step1 打开cmd 以管理员方式运行(点击菜单,找到windows系统文件夹,右击命令提示器,右键选择以管理员身份运行)
在这里插入图片描述
step2 使用命令$ python -m pip install --upgrade pip 更新pip
【注意】命令执行不成功就多试几次,网络原因也会导致安装失败。
出现以下说明pip更新成功
在这里插入图片描述
step3 输入命令 安装pytest $ pip install pytest
在这里插入图片描述
安装成功

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值