简体   繁体   中英

How to suppress outdated pip warning

Every pip command ends with a warning:

You are using pip version 18.1, however version 19.3.1 is available. You should consider upgrading via the 'python -m pip install --upgrade pip' command.

However, updating pip doesn't work, see below. Can I suppress the warning, and how? Can I update pip, and how?

在此处输入图像描述

C:\WINDOWS\system32>python -m pip install --upgrade pip Collecting pip Downloading https://files.pythonhosted.org/packages/00/b6/9cfa56b4081ad13874b0c6f96af8ce16cfbc1cb06bedf8e9164ce5551ec1/pip-19.3.1-py2.py3-none-any.whl (1.4MB) 100% |████████████████████████████████| 1.4MB 7.3MB/s Installing collected packages: pip Found existing installation: pip 18.1 Uninstalling pip-18.1: Successfully uninstalled pip-18.1 Rolling back uninstall of pip Exception: Traceback (most recent call last): File "C:\Users\Dzenan\AppData\Roaming\Python\Python37\site-packages\pip_internal\cli\base_command.py", line 143, in main status = self.run(options, args) File "C:\Users\Dzenan\AppData\Roaming\Python\Python37\site-packages\pip_internal\commands\install.py", line 366, in run use_user_site=options.use_user_site, File "C:\Users\Dzenan\AppData\Roaming\Python\Python37\site-packages\pip_internal\req__init__.py", line 49, in install_given_reqs **kwargs File "C:\Users\Dzenan\AppData\Roaming\Python\Python37\site-packages\pip_internal\req\req_install.py", line 760, in install use_user_site=use_user_site, pycompile=pycompile, File "C:\Users\Dzenan\AppData\Roaming\Python\Python37\site-packag es\pip_internal\req\req_install.py", line 382, in move_wheel_files warn_script_location=warn_script_location, File "C:\Users\Dzenan\AppData\Roaming\Python\Python37\site-packages\pip_internal\wheel.py", line 441, in move_wheel_files generated.extend(maker.make(spec)) File "C:\Users\Dzenan\AppData\Roaming\Python\Python37\site-packages\pip_vendor\distlib\scripts.py", line 403, in make self._make_script(entry, filenames, options=options) File "C:\Users\Dzenan\AppData\Roaming\Python\Python37\site-packages\pip_vendor\distlib\scripts.py", line 307, in _make_script self._write_script(scriptnames, shebang, script, filenames, ext) File "C:\Users\Dzenan\AppData\Roaming\Python\Python37\site-packages\pip_vendor\distlib\scripts.py", line 243, in _write_script launcher = self._get_launcher('t') File "C:\Users\Dzenan\AppData\Roaming\Python\Python37\site-packages\pip_vendor\distlib\scripts.py", line 382, in _get_launcher result = finder(distlib_package).find(name).bytes AttributeError: 'NoneType' ZA8CF DE6331BD59EB2AC96F8911C4B666Z has no attribute 'bytes' You are using pip version 18.1, however version 19.3.1 is available. You should consider upgrading via the 'python -m pip install --upgrade pip' command.

C:\WINDOWS\system32>pip --version pip 18.1 from C:\Users\Dzenan\AppData\Roaming\Python\Python37\site-packages\pip (python 3.7)

To upgrade pip on Windows, you may find answers in this thread . This seems to be the solution:

python -m pip install -U --force-reinstall pip

Or to answer your actual question about suppressing pip warnings, pip has the -q/-qq/-qqq option to suppress logging output.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM