解决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.
解决pytest安装失败、python安装依赖报错Could not find a version that satisfies the requirement_第1张图片
尝试更换软件安装源,更改命令、pycharm安装均失败。
【三步解决】更新pip
step1 打开cmd 以管理员方式运行(点击菜单,找到windows系统文件夹,右击命令提示器,右键选择以管理员身份运行)
解决pytest安装失败、python安装依赖报错Could not find a version that satisfies the requirement_第2张图片
step2 使用命令$ python -m pip install --upgrade pip 更新pip
【注意】命令执行不成功就多试几次,网络原因也会导致安装失败。
出现以下说明pip更新成功
解决pytest安装失败、python安装依赖报错Could not find a version that satisfies the requirement_第3张图片
step3 输入命令 安装pytest $ pip install pytest
解决pytest安装失败、python安装依赖报错Could not find a version that satisfies the requirement_第4张图片
安装成功

你可能感兴趣的:(测试,python,pytest,pycharm)