ubuntu 安装ciso8601库 失败, 已解决

ubuntu20; ciso8601库是一个高性能的时间解析库,基于C底层写的。pip install ciso8601 报错 : 
      Collecting setuptools>=40.8.0
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Read timed out. (read timeout=15)")': /packages/a4/53/bfc6409447ca024558b8b19d055de94c813c3e32c0296c48a0873a161cf5/setuptools-63.2.0-py3-none-any.whl
Downloading setuptools-63.2.0-py3-none-any.whl (1.2 MB)
━━━━╸ 0.1/1.2 MB 102.5 kB/s eta 0:00:11
ERROR: Exception:
Traceback (most recent call last):
File "/tmp/pip-standalone-pip-oas0cddc/__env_pip__.zip/pip/_vendor/urllib3/response.py", line 435, in _error_catcher
yield
File "/tmp/pip-standalone-pip-oas0cddc/__env_pip__.zip/pip/_vendor/urllib3/response.py", line 516, in read
data = self._fp.read(amt) if not fp_closed else b""
File "/tmp/pip-standalone-pip-oas0cddc/__env_pip__.zip/pip/_vendor/cachecontrol/filewrapper.py", line 90, in read
data = self.__fp.read(amt)
File "/home/xda/miniconda3/envs/cpy/lib/python3.9/http/client.py", line 462, in read
n = self.readinto(b)
File "/home/xda/miniconda3/envs/cpy/lib/python3.9/http/client.py", line 506, in readinto
n = self.fp.readinto(b)
File "/home/xda/miniconda3/envs/cpy/lib/python3.9/socket.py", line 704, in readinto
return self._sock.recv_into(b)
File "/home/xda/miniconda3/envs/cpy/lib/python3.9/ssl.py", line 1241, in recv_into
return self.read(nbytes, buffer)
File "/home/xda/miniconda3/envs/cpy/lib/python3.9/ssl.py", line 1099, in read
return self._sslobj.read(len, buffer)
socket.timeout: The read operation timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/tmp/pip-standalone-pip-oas0cddc/__env_pip__.zip/pip/_internal/cli/base_command.py", line 167, in exc_logging_wrapper
status = run_func(*args)
File "/tmp/pip-standalone-pip-oas0cddc/__env_pip__.zip/pip/_internal/cli/req_command.py", line 205, in wrapper
return func(self, options, args)
File "/tmp/pip-standalone-pip-oas0cddc/__env_pip__.zip/pip/_internal/commands/install.py", line 341, in run
requirement_set = resolver.resolve(
File "/tmp/pip-standalone-pip-oas0cddc/__env_pip__.zip/pip/_internal/resolution/resolvelib/resolver.py", line 94, in resolve
result = self._result = resolver.resolve(
File "/tmp/pip-standalone-pip-oas0cddc/__env_pip__.zip/pip/_vendor/resolvelib/resolvers.py", line 481, in resolve
state = resolution.resolve(requirements, max_rounds=max_rounds)
File "/tmp/pip-standalone-pip-oas0cddc/__env_pip__.zip/pip/_vendor/resolvelib/resolvers.py", line 348, in resolve
self._add_to_criteria(self.state.criteria, r, parent=None)
File "/tmp/pip-standalone-pip-oas0cddc/__env_pip__.zip/pip/_vendor/resolvelib/resolvers.py", line 172, in _add_to_criteria
if not criterion.candidates:
File "/tmp/pip-standalone-pip-oas0cddc/__env_pip__.zip/pip/_vendor/resolvelib/structs.py", line 151, in __bool__
return bool(self._sequence)
File "/tmp/pip-standalone-pip-oas0cddc/__env_pip__.zip/pip/_internal/resolution/resolvelib/found_candidates.py", line 155, in __bool__
return any(self)
File "/tmp/pip-standalone-pip-oas0cddc/__env_pip__.zip/pip/_internal/resolution/resolvelib/found_candidates.py", line 143, in <genexpr>
return (c for c in iterator if id(c) not in self._incompatible_ids)
File "/tmp/pip-standalone-pip-oas0cddc/__env_pip__.zip/pip/_internal/resolution/resolvelib/found_candidates.py", line 47, in _iter_built
candidate = func()
File "/tmp/pip-standalone-pip-oas0cddc/__env_pip__.zip/pip/_internal/resolution/resolvelib/factory.py", line 215, in _make_candidate_from_link
self._link_candidate_cache[link] = LinkCandidate(
File "/tmp/pip-standalone-pip-oas0cddc/__env_pip__.zip/pip/_internal/resolution/resolvelib/candidates.py", line 291, in __init__
super().__init__(
File "/tmp/pip-standalone-pip-oas0cddc/__env_pip__.zip/pip/_internal/resolution/resolvelib/candidates.py", line 161, in __init__
self.dist = self._prepare()
File "/tmp/pip-standalone-pip-oas0cddc/__env_pip__.zip/pip/_internal/resolution/resolvelib/candidates.py", line 230, in _prepare
dist = self._prepare_distribution()
File "/tmp/pip-standalone-pip-oas0cddc/__env_pip__.zip/pip/_internal/resolution/resolvelib/candidates.py", line 302, in _prepare_distribution
return preparer.prepare_linked_requirement(self._ireq, parallel_builds=True)
File "/tmp/pip-standalone-pip-oas0cddc/__env_pip__.zip/pip/_internal/operations/prepare.py", line 428, in prepare_linked_requirement
return self._prepare_linked_requirement(req, parallel_builds)
File "/tmp/pip-standalone-pip-oas0cddc/__env_pip__.zip/pip/_internal/operations/prepare.py", line 473, in _prepare_linked_requirement
local_file = unpack_url(
File "/tmp/pip-standalone-pip-oas0cddc/__env_pip__.zip/pip/_internal/operations/prepare.py", line 155, in unpack_url
file = get_http_url(
File "/tmp/pip-standalone-pip-oas0cddc/__env_pip__.zip/pip/_internal/operations/prepare.py", line 96, in get_http_url
from_path, content_type = download(link, temp_dir.path)
File "/tmp/pip-standalone-pip-oas0cddc/__env_pip__.zip/pip/_internal/network/download.py", line 146, in __call__
for chunk in chunks:
File "/tmp/pip-standalone-pip-oas0cddc/__env_pip__.zip/pip/_internal/cli/progress_bars.py", line 53, in _rich_progress_bar
for chunk in iterable:
File "/tmp/pip-standalone-pip-oas0cddc/__env_pip__.zip/pip/_internal/network/utils.py", line 63, in response_chunks
for chunk in response.raw.stream(
File "/tmp/pip-standalone-pip-oas0cddc/__env_pip__.zip/pip/_vendor/urllib3/response.py", line 573, in stream
data = self.read(amt=amt, decode_content=decode_content)
File "/tmp/pip-standalone-pip-oas0cddc/__env_pip__.zip/pip/_vendor/urllib3/response.py", line 538, in read
raise IncompleteRead(self._fp_bytes_read, self.length_remaining)
File "/home/xda/miniconda3/envs/cpy/lib/python3.9/contextlib.py", line 137, in __exit__
self.gen.throw(typ, value, traceback)
File "/tmp/pip-standalone-pip-oas0cddc/__env_pip__.zip/pip/_vendor/urllib3/response.py", line 440, in _error_catcher
raise ReadTimeoutError(self._pool, None, "Read timed out.")
pip._vendor.urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Read timed out.
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error
 
 
看样子,是setuptool的问题。 为了避免动这个默认库,可以安装降级版本的ciso。
pip install ciso8601==1.0.7
 

20220722001.png

 

0 个评论

要回复文章请先登录注册