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

解决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

安装成功

文章出处登录后可见!

已经登录?立即刷新

共计人评分,平均

到目前为止还没有投票!成为第一位评论此文章。

(0)
xiaoxingxing的头像xiaoxingxing管理团队
上一篇 2023年6月20日
下一篇 2023年6月20日

相关推荐