Nous partagerons l'erreur et la solution survenues lors de la mise à niveau de la bibliothèque pip sur le PC (Windows10) au travail. Cela semble se produire lors de l'accès à Internet.
J'ai essayé de mettre à niveau la bibliothèque pip sur mon PC de travail, mais j'ai eu l'erreur suivante et je n'ai pas pu mettre à niveau.
$ 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: ''
Ouvrez Registry Editor
et changez le type de HKEY_CURRENT_USER \ Software \ Microsoft \ Windows \ CurrentVersion \ Internet Settings \ ProxyEnable
en REG_BINARY
.
Je ne connais pas très bien ce domaine, donc on ne sait toujours pas pourquoi cette solution fonctionne. Cependant, comme cette erreur se produit fréquemment, j'ai écrit un article comprenant la signification de l'enregistrement pour moi-même.
D'ailleurs, cela ne s'est jamais produit sur un PC privé (Mac OS).
Recommended Posts