问题描述
WARNING: You are using pip version 21.1.2; however, version 22.1.2 is available.
You should consider upgrading via the 'C:\Users\PycharmProjects\pythonProject\venv\Scripts\python.exe -m pip install --upgrade pip' command.
直接按照提示在python.exe中输入 -m pip install --upgrade pip
经过查询百度,采用下面文章找到解决办法
解决方法:
1.在Terminal输入:
注:此处只涉及到本次项目的pip进行修改,其他项目不做修改
Windows PowerShell
版权所有 (C) Microsoft Corporation。保留所有权利。
尝试新的跨平台 PowerShell https://aka.ms/pscore6
PS C:\Users\euweb\PycharmProjects\pythonProject2> python -m pip install --upgrade pip
ages (21.3.1)
Collecting pip
Downloading pip-22.1.2-py3-none-any.whl (2.1 MB)
|████████████████████████████████| 2.1 MB 939 kB/s
Installing collected packages: pip
Attempting uninstall: pip
Found existing installation: pip 21.3.1
Uninstalling pip-21.3.1:
Successfully uninstalled pip-21.3.1
Successfully installed pip-22.1.2
PS C:\Users\euweb\PycharmProjects\pythonProject2>
PS C:\Users\euweb\PycharmProjects\pythonProject2>
2.打开cmd(此办法没有验证,不过应该也可以)
注:修改全部的项目
总结:
降低pip到指定版本(通过PyCharm升级pip,在降低到原来版本)
方法1:直接在terminal中通过命令进行pip本版切换
具体命令参照降低pip到指定版本(通过cmp升级pip,在降低到原来版本)
方法2:通过setting进行设置,具体操作流程如下所示
降低pip到指定版本(通过cmp升级pip,在降低到原来版本)
升级到最新本版脚本:python -m pip install --upgrade pip
指定版本升降的脚本:python -m pip install pip==21.2.4(22.1.2)
查看本版的脚本:pip show pip
C:\Users\euweb>python -m pip install pip==21.2.4
Defaulting to user installation because normal site-packages is not writeable
Collecting pip==21.2.4
Downloading pip-21.2.4-py3-none-any.whl (1.6 MB)
---------------------------------------- 1.6/1.6 MB 4.1 MB/s eta 0:00:00
Installing collected packages: pip
Attempting uninstall: pip
Found existing installation: pip 22.1.2
Uninstalling pip-22.1.2:
Successfully uninstalled pip-22.1.2
WARNING: The scripts pip.exe, pip3.10.exe and pip3.exe are installed in 'C:\Users\euweb\AppData\Roaming\Python\Python310\Scripts' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed pip-21.2.4
C:\Users\euweb>pip show pip
Name: pip
Version: 21.2.4
Summary: The PyPA recommended tool for installing Python packages.
Home-page: https://pip.pypa.io/
Author: The pip developers
Author-email: distutils-sig@python.org
License: MIT
Location: c:\users\euweb\appdata\roaming\python\python310\site-packages
Requires:
Required-by: