gpt4 book ai didi

Python 3.7 - Windows 10 上的 PIP 升级错误

转载 作者:行者123 更新时间:2023-12-01 01:21:40 25 4
gpt4 key购买 nike

我尝试使用命令在控制台中更新 PIP(Windows 10、Python 3.7.1):

python37 -m pip install --upgrade pip

这是我每次尝试更新时都会遇到的错误:

>Exception:
Traceback (most recent call last):
File "C:\Users\5gyblo\AppData\Roaming\Python\Python37\site-packages\pip\basecommand.py", line 215, in main
status = self.run(options, args)
File "C:\Users\5gyblo\AppData\Roaming\Python\Python37\site-packages\pip\commands\install.py", line 342, in run
prefix=options.prefix_path,
File "C:\Users\5gyblo\AppData\Roaming\Python\Python37\site-packages\pip\req\req_set.py", line 784, in install
**kwargs
File "C:\Users\5gyblo\AppData\Roaming\Python\Python37\site-packages\pip\req\req_install.py", line 851, in install
self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
File "C:\Users\5gyblo\AppData\Roaming\Python\Python37\site-packages\pip\req\req_install.py", line 1064, in move_wheel_files
isolated=self.isolated,
File "C:\Users\5gyblo\AppData\Roaming\Python\Python37\site-packages\pip\wheel.py", line 462, in move_wheel_files
generated.extend(maker.make(spec))
File "C:\Users\5gyblo\AppData\Roaming\Python\Python37\site-packages\pip\_vendor\distlib\scripts.py", line 372, in make
self._make_script(entry, filenames, options=options)
File "C:\Users\5gyblo\AppData\Roaming\Python\Python37\site-packages\pip\_vendor\distlib\scripts.py", line 276, in _make_script
self._write_script(scriptnames, shebang, script, filenames, ext)
File "C:\Users\5gyblo\AppData\Roaming\Python\Python37\site-packages\pip\_vendor\distlib\scripts.py", line 212, in _write_script
launcher = self._get_launcher('t')
File "C:\Users\5gyblo\AppData\Roaming\Python\Python37\site-packages\pip\_vendor\distlib\scripts.py", line 351, in _get_launcher
result = finder(distlib_package).find(name).bytes
AttributeError: 'NoneType' object has no attribute 'bytes'

令人惊讶的事实 - 我在 Python 2.7 上成功更新了 PIP,没有任何问题。

最佳答案

我在尝试从 pip 版本 18.1 升级到 19.0.3 时遇到此错误。经过大量搜索后,我找到了解决方案 https://packaging.python.org/tutorials/installing-packages/(如果仍然不允许您运行 pip:

安全下载 get-pip.py [1]

运行 python get-pip.py。 [2] 这将安装或升级 pip。此外,如果尚未安装,它将安装 setuptools 和wheel。)

该链接会将您带到:

使用https://bootstrap.pypa.io/get-pip.py

下载并保存文件,从命令提示符运行它。它对我来说就像一种魅力。

关于Python 3.7 - Windows 10 上的 PIP 升级错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53764054/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com