【问题标题】:I was trying to install numpy using pipenv with the code "pipenv install python" but it kept on coming up with errors我试图使用带有代码“pipenv install python”的pipenv安装numpy,但它不断出现错误
【发布时间】:2020-06-27 18:08:42
【问题描述】:

我试图使用带有代码“pipenv install python”的 pipenv 安装 numpy,但它不断出现错误。下面是我在尝试安装时在终端中得到的最后一个输出。有人可以帮我调试一下吗。

当我尝试安装 numpy 时,出现以下错误: 锁定失败! 回溯(最近一次通话最后): _error_catcher 中的文件“c:\users\calibest\appdata\local\programs\python\python38-32\lib\site-packages\pipenv\patched\notpip_vendor\urllib3\response.py”,第 425 行 屈服 文件“c:\users\calibest\appdata\local\programs\python\python38-32\lib\site-packages\pipenv\patched\notpip_vendor\urllib3\response.py”,第 507 行,已读取 data = self._fp.read(amt) if not fp_closed else b"" 文件“c:\users\calibest\appdata\local\programs\python\python38-32\lib\site-packages\pipenv\patched\notpip_vendor\cachecontrol\filewrapper.py”,第 62 行,已读 数据 = self.__fp.read(amt) 文件“c:\users\calibest\appdata\local\programs\python\python38-32\lib\http\client.py”,第 454 行,已读取 n = self.readinto(b) 文件“c:\users\calibest\appdata\local\programs\python\python38-32\lib\http\client.py”,第 498 行,在 readinto n = self.fp.readinto(b) 文件“c:\users\calibest\appdata\local\programs\python\python38-32\lib\socket.py”,第 669 行,在 读入 返回 self._sock.recv_into(b) 文件“c:\users\calibest\appdata\local\programs\python\python38-32\lib\ssl.py”,第 1241 行,在 recv_into 返回self.read(nbytes,缓冲区) 文件“c:\users\calibest\appdata\local\programs\python\python38-32\lib\ssl.py”,第 1099 行,正在读取 返回 self._sslobj.read(len, buffer) socket.timeout:读操作超时

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "c:/users/calibest/appdata/local/programs/python/python38-32/lib/site-packages/pipenv/resolver.py", line 807, in <module>
    main()
  File "c:/users/calibest/appdata/local/programs/python/python38-32/lib/site-packages/pipenv/resolver.py", line 802, in main
    _main(parsed.pre, parsed.clear, parsed.verbose, parsed.system, parsed.write,
  File "c:/users/calibest/appdata/local/programs/python/python38-32/lib/site-packages/pipenv/resolver.py", line 785, in _main
    resolve_packages(pre, clear, verbose, system, write, requirements_dir, packages)
  File "c:/users/calibest/appdata/local/programs/python/python38-32/lib/site-packages/pipenv/resolver.py", line 746, in resolve_packages
    results, resolver = resolve(
  File "c:/users/calibest/appdata/local/programs/python/python38-32/lib/site-packages/pipenv/resolver.py", line 728, in resolve
    return resolve_deps(
  File "c:\users\calibest\appdata\local\programs\python\python38-32\lib\site-packages\pipenv\utils.py", line 1378, in resolve_deps
    results, hashes, markers_lookup, resolver, skipped = actually_resolve_deps(
  File "c:\users\calibest\appdata\local\programs\python\python38-32\lib\site-packages\pipenv\utils.py", line 1093, in actually_resolve_deps
    resolver.resolve()
  File "c:\users\calibest\appdata\local\programs\python\python38-32\lib\site-packages\pipenv\utils.py", line 808, in resolve
    results = self.resolver.resolve(max_rounds=environments.PIPENV_MAX_ROUNDS)
  File "c:\users\calibest\appdata\local\programs\python\python38-32\lib\site-packages\pipenv\patched\piptools\resolver.py", line 180, in resolve
    has_changed, best_matches = self._resolve_one_round()
  File "c:\users\calibest\appdata\local\programs\python\python38-32\lib\site-packages\pipenv\patched\piptools\resolver.py", line 268, in _resolve_one_round
    their_constraints.extend(self._iter_dependencies(best_match))
  File "c:\users\calibest\appdata\local\programs\python\python38-32\lib\site-packages\pipenv\patched\piptools\resolver.py", line 383, in _iter_dependencies
    dependencies = self.repository.get_dependencies(ireq)
  File "c:\users\calibest\appdata\local\programs\python\python38-32\lib\site-packages\pipenv\patched\piptools\repositories\pypi.py", line 226, in get_dependencies
    legacy_results = self.get_legacy_dependencies(ireq)
  File "c:\users\calibest\appdata\local\programs\python\python38-32\lib\site-packages\pipenv\patched\piptools\repositories\pypi.py", line 347, in get_legacy_dependencies
    results, ireq = self.resolve_reqs(
  File "c:\users\calibest\appdata\local\programs\python\python38-32\lib\site-packages\pipenv\patched\piptools\repositories\pypi.py", line 303, in resolve_reqs
    results = resolver._resolve_one(reqset, ireq)
  File "c:\users\calibest\appdata\local\programs\python\python38-32\lib\site-packages\pipenv\patched\notpip\_internal\legacy_resolve.py", line 339, in _resolve_one
    abstract_dist = self._get_abstract_dist_for(req_to_install)
  File "c:\users\calibest\appdata\local\programs\python\python38-32\lib\site-packages\pipenv\patched\notpip\_internal\legacy_resolve.py", line 287, in _get_abstract_dist_for
    abstract_dist = self.preparer.prepare_linked_requirement(req)
  File "c:\users\calibest\appdata\local\programs\python\python38-32\lib\site-packages\pipenv\patched\notpip\_internal\operations\prepare.py", line 473, in prepare_linked_requirement
    local_path = unpack_url(
  File "c:\users\calibest\appdata\local\programs\python\python38-32\lib\site-packages\pipenv\patched\notpip\_internal\operations\prepare.py", line 282, in unpack_url
    return unpack_http_url(
  File "c:\users\calibest\appdata\local\programs\python\python38-32\lib\site-packages\pipenv\patched\notpip\_internal\operations\prepare.py", line 158, in unpack_http_url
    from_path, content_type = _download_http_url(
  File "c:\users\calibest\appdata\local\programs\python\python38-32\lib\site-packages\pipenv\patched\notpip\_internal\operations\prepare.py", line 303, in _download_http_url
    for chunk in download.chunks:
  File "c:\users\calibest\appdata\local\programs\python\python38-32\lib\site-packages\pipenv\patched\notpip\_internal\network\utils.py", line 15, in response_chunks
    for chunk in response.raw.stream(
  File "c:\users\calibest\appdata\local\programs\python\python38-32\lib\site-packages\pipenv\patched\notpip\_vendor\urllib3\response.py", line 564, in stream
    data = self.read(amt=amt, decode_content=decode_content)
  File "c:\users\calibest\appdata\local\programs\python\python38-32\lib\site-packages\pipenv\patched\notpip\_vendor\urllib3\response.py", line 529, in read
    raise IncompleteRead(self._fp_bytes_read, self.length_remaining)
  File "c:\users\calibest\appdata\local\programs\python\python38-32\lib\contextlib.py", line 131, in __exit__
    self.gen.throw(type, value, traceback)
  File "c:\users\calibest\appdata\local\programs\python\python38-32\lib\site-packages\pipenv\patched\notpip\_vendor\urllib3\response.py", line 430, in _error_catcher
    raise ReadTimeoutError(self._pool, None, "Read timed out.")
pipenv.patched.notpip._vendor.urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Read timed out.

【问题讨论】:

  • 您可能想要使用更具体的标题,以帮助引起遇到此问题的人的注意,例如,“为什么我在尝试安装 Numpy 时遇到超时错误”。另外,如果你想安装 Numpy,你应该在你的命令中使用它 pipenv install numpy

标签: python python-3.x pip pipenv


【解决方案1】:

默认情况下应安装 Python。尝试使用pipenv --py 查看python解释器安装位置的详细信息。

【讨论】:

    猜你喜欢
    • 2019-10-31
    • 2020-08-11
    • 1970-01-01
    • 1970-01-01
    • 2023-01-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-10-30
    相关资源
    最近更新 更多