python3怎么看是否安装pip(Python3pip升级报错问题解决方法分享)

Python在安装第三方库时有这样的报错提醒:

ERROR: To modify PIP, please run the following command: C:\Program Files\python3-10\python.exe -m pip install --user --upgrade pip WARNING: Ignoring invalid distribution -irsearch (c:\program Files\python3-10\lib\site-packages) [notice] A new release of pip available: 22.1.2 -> 22.3.1 [notice] To update, run: python.exe -m pip install --upgrade pip

但是当你按照提醒执行命令时会继续报错,详细如下:

C:\Users\moke>python -m pip install --upgrade pip WARNING: Ignoring invalid distribution -irsearch (c:\program files\python3-10\lib\site-packages) WARNING: Ignoring invalid distribution -irsearch (c:\program files\python3-10\lib\site-packages) Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple Requirement already satisfied: pip in c:\users\moke\appdata\roaming\python\python310\site-packages (22.1.2) Collecting pip Using cached https://pypi.tuna.tsinghua.edu.cn/packages/09/bd/2410905c76ee14c62baf69e3f4aa780226c1bbfc9485731ad018e35b0cb5/pip-22.3.1-py3-none-any.whl (2.1 MB) WARNING: Ignoring invalid distribution -irsearch (c:\program files\python3-10\lib\site-packages) 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 ERROR: Exception: Traceback (most recent call last): File "C:\Users\moke\AppData\Roaming\Python\Python310\site-packages\pip\_internal\cli\base_command.py", line 167, in exc_logging_wrapper status = run_func(*args) ************************************************** File "C:\Users\moke\AppData\Roaming\Python\Python310\site-packages\pip\_vendor\distlib\scripts.py", line 396, in _get_launcher raise ValueError(msg) ValueError: Unable to find resource t64.exe in package pip._vendor.distlib WARNING: Ignoring invalid distribution -irsearch (c:\program files\python3-10\lib\site-packages)

python3怎么看是否安装pip(Python3pip升级报错问题解决方法分享)(1)

解决方法1:升级setuptools

升级:pip install --upgrade setuptools

版本:python -m pip show setuptools

再升级:python -m pip install --upgrade pip

python3怎么看是否安装pip(Python3pip升级报错问题解决方法分享)(2)

解决方法2:卸载&重装setuptools

卸载:python -m pip uninstall pip setuptools

安装:pip install --upgrade setuptools

再升级:python -m pip install --upgrade pip

升级查看PIP 版本

C:\Users\moke>pip show pip WARNING: Ignoring invalid distribution -irsearch (c:\program files\python3-10\lib\site-packages) Name: pip Version: 22.3.1 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:\program files\python3-10\lib\site-packages Requires: Required-by:

python3怎么看是否安装pip(Python3pip升级报错问题解决方法分享)(3)

问题解决

欢迎需要的朋友点赞关注

,

免责声明:本文仅代表文章作者的个人观点,与本站无关。其原创性、真实性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容文字的真实性、完整性和原创性本站不作任何保证或承诺,请读者仅作参考,并自行核实相关内容。文章投诉邮箱:anhduc.ph@yahoo.com

    分享
    投诉
    首页