I'm a Python beginner.
I would appreciate it if you could let me know how to deal with the error when I run pip installation from cmd.
environment
Windows 10
Python 3.7.3
pip19.0.3
Error (run pip install reportlab)
Collecting reportlab
Exception:
Traceback (most recent call last):
File "c:\users\yamada\appdata\local\programs\python\python37-32\lib\site-packages\pip\_internal\cli\base_command.py", line 179, main
status=self.run(options,args)
File "c:\users\yamada\appdata\local\programs\python\python37-32\lib\site-packages\pip\_internal\commands\install.py", line 315, in run
resolver.resolve(requirement_set)
File "c:\users\yamada\appdata\local\programs\python\python37-32\lib\site-packages\pip\_internal\resolve.py", line 131, in resolve
self._resolve_one (requirement_set, req)
File "c:\users\yamada\appdata\local\programs\python\python37-32\lib\site-packages\pip\_internal\resolve.py", line 294, in_resolve_one
abstract_dist=self._get_abstract_dist_for (req_to_install)
File "c:\users\yamada\appdata\local\programs\python\python37-32\lib\site-packages\pip\_internal\resolve.py", line 242, in_get_abstract_dist_for
self.require_hashes
File "c:\users\yamada\appdata\local\programs\python\python37-32\lib\site-packages\pip\_internal\operations\prepare.py", line 269, prepare_linked_requirement
req.populate_link (finder, upgrade_allowed, require_hashes)
File "c:\users\yamada\appdata\local\programs\python\python37-32\lib\site-packages\pip\_internal\req\req_install.py", line 196, impopulate_link
self.link=finder.find_requirement(self, upgrade)
File "c:\users\yamada\appdata\local\programs\python\python37-32\lib\site-packages\pip\_internal\index.py", line 639, find_requirement
all_candidates=self.find_all_candidates(req.name)
File "c:\users\yamada\appdata\local\programs\python\python37-32\lib\site-packages\pip\_internal\index.py", line 610, find_all_candides
for page in self._get_pages(url_locations, project_name):
File "c:\users\yamada\appdata\local\programs\python\python37-32\lib\site-packages\pip\_internal\index.py", line 743, in_get_pages
page=_get_html_page(location, session=self.session)
File "c:\users\yamada\appdata\local\programs\python\python37-32\lib\site-packages\pip\_internal\index.py", line 229, in_get_html_page
resp=_get_html_response(url, session=session)
File "c:\users\yamada\appdata\local\programs\python\python37-32\lib\site-packages\pip\_internal\index.py", line 177, in_get_html_response
"Cache-Control": "max-age=0",
File "c:\users\yamada\appdata\local\programs\python\python37-32\lib\site-packages\pip\_vendor\requests\sessions.py", line 546, inget
return self.request ('GET', url, **kwargs)
File "c:\users\yamada\appdata\local\programs\python\python37-32\lib\site-packages\pip\_internal\download.py", line 403, in request
return super(PipSession,self).request(method,url,*args,**kwargs)
File "c:\users\yamada\appdata\local\programs\python\python37-32\lib\site-packages\pip\_vendor\requests\sessions.py", line 524, in request
prep.url, proxies, stream, verify, cert
File "c:\users\yamada\appdata\local\programs\python\python37-32\lib\site-packages\pip\_vendor\requests\sessions.py", line 700, emerge_environment_settings
env_proxies=get_environ_proxies(url, no_proxy=no_proxy)
File "c:\users\yamada\appdata\local\programs\python\python37-32\lib\site-packages\pip\_vendor\requests\utils.py", line 761, inget_environ_proxies
if should_bypass_proxy(url, no_proxy=no_proxy):
File "c:\users\yamada\appdata\local\programs\python\python37-32\lib\site-packages\pip\_vendor\requests\utils.py", line 745, in should_bypass_proxies
bypass=proxy_bypass(parsed.hostname)
File "c:\users\yamada\appdata\local\programs\python\python37-32\lib\site-packages\pip\_vendor\requests\utils.py", line 95, inproxy_bypass
return proxy_bypass_registry(host)
File "c:\users\yamada\appdata\local\programs\python\python37-32\lib\site-packages\pip\_vendor\requests\utils.py", line 61, inproxy_bypass_registry
'ProxyEnable') [0])
ValueError: invalid literal for int() with base 10:b'\x00\x00\x00'
Similar Questions for Home SO and Similar Questions for Comments were all resolved by rewriting the registry.
From the registry editor, change the HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ProxyEnable
type to REG_DWORD
.(It may be of the REG_BINARY
type)
This is a guess, but installing Python 32-bit on Windows 64-bit seems to cause an error when pip goes to read the registry when it connects to the network.
Therefore, I expect that explicitly specifying proxy will work properly without invoking the decision logic using the registry.
In addition, it is stated that even if the Python 32-bit version was uninstalled and the 64-bit version was re-installed, the problem was not resolved.
The registry was then rewritten to resolve the issue.
© 2024 OneMinuteCode. All rights reserved.