共计 2845 个字符,预计需要花费 8 分钟才能阅读完成。
windows anaconda pip 安装错误,返回 AttributeError: ‘NoneType’ object has no attribute ‘startswith’
解决办法:
参见 https://stackoverflow.com/questions/46260169/python-locationvalueerror-no-host-specified
修改 windows 注册表
HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionInternet Settings ProxyEnable
删除 ProxyEnable
新建 DWORD(32 位) 值
(REG_DWORD 0x00000000(0))
Traceback (most recent call last):
File “C:Anacondalibsite-packagescondaexceptions.py”, line 634, in conda_exception_handler
return_value = func(*args, **kwargs)
File “C:Anacondalibsite-packagescondaclimain.py”, line 140, in _main
exit_code = args.func(args, p)
File “C:Anacondalibsite-packagescondaclimain_update.py”, line 65, in execute
install(args, parser, ‘update’)
File “C:Anacondalibsite-packagescondacliinstall.py”, line 228, in install
unknown=index_args[‘unknown’], prefix=prefix)
File “C:Anacondalibsite-packagescondacoreindex.py”, line 101, in get_index
index = fetch_index(channel_priority_map, use_cache=use_cache)
File “C:Anacondalibsite-packagescondacoreindex.py”, line 120, in fetch_index
repodatas = collect_all_repodata(use_cache, tasks)
File “C:Anacondalibsite-packagescondacorerepodata.py”, line 74, in collect_all_repodata
repodatas = _collect_repodatas_serial(use_cache, tasks)
File “C:Anacondalibsite-packagescondacorerepodata.py”, line 479, in _collect_repodatas_serial
for url, schan, pri in tasks]
File “C:Anacondalibsite-packagescondacorerepodata.py”, line 479, in <listcomp>
for url, schan, pri in tasks]
File “C:Anacondalibsite-packagescondacorerepodata.py”, line 109, in func
res = f(*args, **kwargs)
File “C:Anacondalibsite-packagescondacorerepodata.py”, line 458, in fetch_repodata
mod_etag_headers.get(‘_mod’))
File “C:Anacondalibsite-packagescondacorerepodata.py”, line 138, in fetch_repodata_remote_request
timeout=timeout)
File “C:Anacondalibsite-packagesrequestssessions.py”, line 531, in get
return self.request(‘GET’, url, **kwargs)
File “C:Anacondalibsite-packagesrequestssessions.py”, line 518, in request
resp = self.send(prep, **send_kwargs)
File “C:Anacondalibsite-packagesrequestssessions.py”, line 639, in send
r = adapter.send(request, **kwargs)
File “C:Anacondalibsite-packagesrequestsadapters.py”, line 438, in send
timeout=timeout
File “C:Anacondalibsite-packagesrequestspackagesurllib3connectionpool.py”, line 594, in urlopen
self._prepare_proxy(conn)
File “C:Anacondalibsite-packagesrequestspackagesurllib3connectionpool.py”, line 810, in _prepare_proxy
conn.connect()
File “C:Anacondalibsite-packagesrequestspackagesurllib3connection.py”, line 284, in connect
conn = self._new_conn()
File “C:Anacondalibsite-packagesrequestspackagesurllib3connection.py”, line 141, in _new_conn
(self.host, self.port), self.timeout, **extra_kw)
File “C:Anacondalibsite-packagesrequestspackagesurllib3utilconnection.py”, line 51, in create_connection
if host.startswith(‘[‘):
AttributeError: ‘NoneType’ object has no attribute ‘startswith’