Wir werden den Fehler und die Lösung mitteilen, die beim Aktualisieren der Pip-Bibliothek auf dem PC (Windows 10) bei der Arbeit aufgetreten sind. Es scheint beim Zugriff auf das Internet aufzutreten.
Ich habe versucht, die Pip-Bibliothek auf meinem Arbeits-PC zu aktualisieren, habe jedoch den folgenden Fehler erhalten und konnte kein Upgrade durchführen.
$ python -m pip install --upgrade pip
ERROR: Exception:
Traceback (most recent call last):
File "C:\Users\yuya_sato\AppData\Local\Programs\Python\Python38\lib\site-packages\pip\_internal\cli\base_command.py", line 188, in main
status = self.run(options, args)
File "C:\Users\yuya_sato\AppData\Local\Programs\Python\Python38\lib\site-packages\pip\_internal\commands\install.py", line 345, in run
resolver.resolve(requirement_set)
File "C:\Users\yuya_sato\AppData\Local\Programs\Python\Python38\lib\site-packages\pip\_internal\legacy_resolve.py", line 196, in resolve
self._resolve_one(requirement_set, req)
File "C:\Users\yuya_sato\AppData\Local\Programs\Python\Python38\lib\site-packages\pip\_internal\legacy_resolve.py", line 359, in _resolve_one
abstract_dist = self._get_abstract_dist_for(req_to_install)
File "C:\Users\yuya_sato\AppData\Local\Programs\Python\Python38\lib\site-packages\pip\_internal\legacy_resolve.py", line 297, in _get_abstract_dist_for
skip_reason = self._check_skip_installed(req)
File "C:\Users\yuya_sato\AppData\Local\Programs\Python\Python38\lib\site-packages\pip\_internal\legacy_resolve.py", line 267, in _check_skip_installed
self.finder.find_requirement(req_to_install, upgrade=True)
File "C:\Users\yuya_sato\AppData\Local\Programs\Python\Python38\lib\site-packages\pip\_internal\index.py", line 1200, in find_requirement
candidates = self.find_candidates(
File "C:\Users\yuya_sato\AppData\Local\Programs\Python\Python38\lib\site-packages\pip\_internal\index.py", line 1183, in find_candidates
candidates = self.find_all_candidates(project_name)
File "C:\Users\yuya_sato\AppData\Local\Programs\Python\Python38\lib\site-packages\pip\_internal\index.py", line 1128, in find_all_candidates
for page in self._get_pages(url_locations, project_name):
File "C:\Users\yuya_sato\AppData\Local\Programs\Python\Python38\lib\site-packages\pip\_internal\index.py", line 1282, in _get_pages
page = _get_html_page(location, session=self.session)
File "C:\Users\yuya_sato\AppData\Local\Programs\Python\Python38\lib\site-packages\pip\_internal\index.py", line 234, in _get_html_page
resp = _get_html_response(url, session=session)
File "C:\Users\yuya_sato\AppData\Local\Programs\Python\Python38\lib\site-packages\pip\_internal\index.py", line 165, in _get_html_response
resp = session.get(
File "C:\Users\yuya_sato\AppData\Local\Programs\Python\Python38\lib\site-packages\pip\_vendor\requests\sessions.py", line 546, in get
return self.request('GET', url, **kwargs)
File "C:\Users\yuya_sato\AppData\Local\Programs\Python\Python38\lib\site-packages\pip\_internal\download.py", line 624, in request
return super(PipSession, self).request(method, url, *args, **kwargs)
File "C:\Users\yuya_sato\AppData\Local\Programs\Python\Python38\lib\site-packages\pip\_vendor\requests\sessions.py", line 523, in request
settings = self.merge_environment_settings(
File "C:\Users\yuya_sato\AppData\Local\Programs\Python\Python38\lib\site-packages\pip\_vendor\requests\sessions.py", line 700, in merge_environment_settings
env_proxies = get_environ_proxies(url, no_proxy=no_proxy)
File "C:\Users\yuya_sato\AppData\Local\Programs\Python\Python38\lib\site-packages\pip\_vendor\requests\utils.py", line 761, in get_environ_proxies
if should_bypass_proxies(url, no_proxy=no_proxy):
File "C:\Users\yuya_sato\AppData\Local\Programs\Python\Python38\lib\site-packages\pip\_vendor\requests\utils.py", line 745, in should_bypass_proxies
bypass = proxy_bypass(parsed.hostname)
File "C:\Users\yuya_sato\AppData\Local\Programs\Python\Python38\lib\site-packages\pip\_vendor\requests\utils.py", line 95, in proxy_bypass
return proxy_bypass_registry(host)
File "C:\Users\yuya_sato\AppData\Local\Programs\Python\Python38\lib\site-packages\pip\_vendor\requests\utils.py", line 60, in proxy_bypass_registry
proxyEnable = int(winreg.QueryValueEx(internetSettings,
ValueError: invalid literal for int() with base 10: ''
Öffnen Sie den Registrierungseditor und ändern Sie den Typ von HKEY_CURRENT_USER \ Software \ Microsoft \ Windows \ CurrentVersion \ Internet Settings \ ProxyEnable in REG_BINARY.
Ich bin mit diesem Bereich nicht sehr vertraut, daher ist immer noch unklar, warum diese Lösung funktioniert. Da dieser Fehler jedoch häufig auftritt, habe ich einen Artikel geschrieben, der die Bedeutung der Aufzeichnung für mich selbst enthält.
Auf einem privaten PC (Mac OS) ist es übrigens noch nie vorgekommen.
Recommended Posts