当使用 来安装任何东西时pip
,它会无限期地挂起,例如(正在运行pip install geoclue2 -v
):
Using pip 21.0.1 from /usr/lib/python3.9/site-packages/pip (python 3.9)
Defaulting to user installation because normal site-packages is not writeable
Created temporary directory: /tmp/pip-ephem-wheel-cache-ujsolamd
Created temporary directory: /tmp/pip-req-tracker-d3dddja9
Initialized build tracking at /tmp/pip-req-tracker-d3dddja9
Created build tracker: /tmp/pip-req-tracker-d3dddja9
Entered build tracker: /tmp/pip-req-tracker-d3dddja9
Created temporary directory: /tmp/pip-install-kl5q0ihq
1 location(s) to search for versions of geoclue2:
* https://pypi.org/simple/geoclue2/
Fetching project page and analyzing links: https://pypi.org/simple/geoclue2/
Getting page https://pypi.org/simple/geoclue2/
Found index url https://pypi.org/simple
Getting credentials from keyring for https://pypi.org/simple
Loading KWallet
Loading SecretService
Loading Windows
Loading chainer
Loading macOS
在这种状态下中断它会产生以下结果:
Exception information:
Traceback (most recent call last):
File "/usr/lib/python3.9/site-packages/pip/_vendor/resolvelib/resolvers.py", line 171, in _merge_into_criterion
crit = self.state.criteria[name]
KeyError: 'geoclue2'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3.9/site-packages/pip/_internal/cli/base_command.py", line 189, in _main
status = self.run(options, args)
File "/usr/lib/python3.9/site-packages/pip/_internal/cli/req_command.py", line 178, in wrapper
return func(self, options, args)
File "/usr/lib/python3.9/site-packages/pip/_internal/commands/install.py", line 316, in run
requirement_set = resolver.resolve(
File "/usr/lib/python3.9/site-packages/pip/_internal/resolution/resolvelib/resolver.py", line 121, in resolve
self._result = resolver.resolve(
File "/usr/lib/python3.9/site-packages/pip/_vendor/resolvelib/resolvers.py", line 453, in resolve
state = resolution.resolve(requirements, max_rounds=max_rounds)
File "/usr/lib/python3.9/site-packages/pip/_vendor/resolvelib/resolvers.py", line 318, in resolve
name, crit = self._merge_into_criterion(r, parent=None)
File "/usr/lib/python3.9/site-packages/pip/_vendor/resolvelib/resolvers.py", line 173, in _merge_into_criterion
crit = Criterion.from_requirement(self._p, requirement, parent)
File "/usr/lib/python3.9/site-packages/pip/_vendor/resolvelib/resolvers.py", line 82, in from_requirement
if not cands:
File "/usr/lib/python3.9/site-packages/pip/_vendor/resolvelib/structs.py", line 124, in __bool__
return bool(self._sequence)
File "/usr/lib/python3.9/site-packages/pip/_internal/resolution/resolvelib/found_candidates.py", line 143, in __bool__
return any(self)
File "/usr/lib/python3.9/site-packages/pip/_internal/resolution/resolvelib/found_candidates.py", line 35, in _iter_built
for version, func in infos:
File "/usr/lib/python3.9/site-packages/pip/_internal/resolution/resolvelib/factory.py", line 220, in iter_index_candidate_infos
result = self._finder.find_best_candidate(
File "/usr/lib/python3.9/site-packages/pip/_internal/index/package_finder.py", line 872, in find_best_candidate
candidates = self.find_all_candidates(project_name)
File "/usr/lib/python3.9/site-packages/pip/_internal/index/package_finder.py", line 815, in find_all_candidates
package_links = self.process_project_url(
File "/usr/lib/python3.9/site-packages/pip/_internal/index/package_finder.py", line 779, in process_project_url
html_page = self._link_collector.fetch_page(project_url)
File "/usr/lib/python3.9/site-packages/pip/_internal/index/collector.py", line 617, in fetch_page
return _get_html_page(location, session=self.session)
File "/usr/lib/python3.9/site-packages/pip/_internal/index/collector.py", line 429, in _get_html_page
resp = _get_html_response(url, session=session)
File "/usr/lib/python3.9/site-packages/pip/_internal/index/collector.py", line 126, in _get_html_response
resp = session.get(
File "/usr/lib/python3.9/site-packages/pip/_vendor/requests/sessions.py", line 555, in get
return self.request('GET', url, **kwargs)
File "/usr/lib/python3.9/site-packages/pip/_internal/network/session.py", line 424, in request
return super().request(method, url, *args, **kwargs)
File "/usr/lib/python3.9/site-packages/pip/_vendor/requests/sessions.py", line 528, in request
prep = self.prepare_request(req)
File "/usr/lib/python3.9/site-packages/pip/_vendor/requests/sessions.py", line 456, in prepare_request
p.prepare(
File "/usr/lib/python3.9/site-packages/pip/_vendor/requests/models.py", line 320, in prepare
self.prepare_auth(auth, url)
File "/usr/lib/python3.9/site-packages/pip/_vendor/requests/models.py", line 551, in prepare_auth
r = auth(self)
File "/usr/lib/python3.9/site-packages/pip/_internal/network/auth.py", line 209, in __call__
url, username, password = self._get_url_and_credentials(req.url)
File "/usr/lib/python3.9/site-packages/pip/_internal/network/auth.py", line 184, in _get_url_and_credentials
username, password = self._get_new_credentials(original_url)
File "/usr/lib/python3.9/site-packages/pip/_internal/network/auth.py", line 156, in _get_new_credentials
get_keyring_auth(index_url, username) or
File "/usr/lib/python3.9/site-packages/pip/_internal/network/auth.py", line 58, in get_keyring_auth
cred = get_credential(url, username)
File "/home/xiaoxiae/.local/lib/python3.9/site-packages/keyring/core.py", line 70, in get_credential
return get_keyring().get_credential(service_name, username)
File "/home/xiaoxiae/.local/lib/python3.9/site-packages/keyring/backends/chainer.py", line 71, in get_credential
credential = keyring.get_credential(service, username)
File "/home/xiaoxiae/.local/lib/python3.9/site-packages/keyring/backends/SecretService.py", line 119, in get_credential
collection = self.get_preferred_collection()
File "/home/xiaoxiae/.local/lib/python3.9/site-packages/keyring/backends/SecretService.py", line 65, in get_preferred_collection
collection.unlock()
File "/home/xiaoxiae/.local/lib/python3.9/site-packages/secretstorage/collection.py", line 67, in unlock
return unlock_objects(self.connection, [self.collection_path])
File "/home/xiaoxiae/.local/lib/python3.9/site-packages/secretstorage/util.py", line 154, in unlock_objects
dismissed, (signature, unlocked) = exec_prompt(connection, prompt)
File "/home/xiaoxiae/.local/lib/python3.9/site-packages/secretstorage/util.py", line 140, in exec_prompt
dismissed, result = connection.recv_until_filtered(signals).body
File "/home/xiaoxiae/.local/lib/python3.9/site-packages/jeepney/io/blocking.py", line 181, in recv_until_filtered
self.recv_messages(timeout=deadline_to_timeout(deadline))
File "/home/xiaoxiae/.local/lib/python3.9/site-packages/jeepney/io/blocking.py", line 116, in recv_messages
msg = self.receive(timeout=timeout)
File "/home/xiaoxiae/.local/lib/python3.9/site-packages/jeepney/io/blocking.py", line 101, in receive
b = self._read_some_data(timeout=deadline_to_timeout(deadline))
File "/home/xiaoxiae/.local/lib/python3.9/site-packages/jeepney/io/blocking.py", line 105, in _read_some_data
for key, ev in self.selector.select(timeout):
File "/usr/lib/python3.9/selectors.py", line 469, in select
fd_event_list = self._selector.poll(timeout, max_ev)
KeyboardInterrupt
Removed build tracker: '/tmp/pip-req-tracker-0pqq_7y5'
我3.9.1
在 Manjaro 上运行 python。
任何帮助将非常感激。
答案1
在弄乱 PyPi 凭据后,我遇到了同样的问题。以下为我修复了它。
export PYTHON_KEYRING_BACKEND=keyring.backends.null.Keyring