【问题标题】:pipenv not consistant from local to serverpipenv 从本地到服务器不一致
【发布时间】:2019-07-25 11:02:53
【问题描述】:

我正在使用 pipenv 来管理我的依赖项, 我有以下命令在我的本地机器上运行良好:

pipenv install --dev

但是当我在服务器上运行它时出现以下错误:

n error occurred while installing pyparsing==2.4.1 --hash=sha256:530d8bf8cc93a34019d08142593cf4d78a05c890da8cf87ffa3120af53772238 --hash=sha256:f78e99616b6f1a4745c0580e170251ef1bbafc0d0513e270c4bd281bf29d2800 --hash=sha256:530d8bf8cc93a34019d08142593cf4d78a05c890da8cf87ffa3120af53772238 --hash=sha256:f78e99616b6f1a4745c0580e170251ef1bbafc0d0513e270c4bd281bf29d2800! Will try again.
  ????   ▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉ 237/237 — 00:00:30
Installing initially failed dependencies…
[pipenv.exceptions.InstallError]:   File "/home/ubuntu/.local/lib/python3.6/site-packages/pipenv/core.py", line 1874, in do_install
[pipenv.exceptions.InstallError]:       keep_outdated=keep_outdated
[pipenv.exceptions.InstallError]:   File "/home/ubuntu/.local/lib/python3.6/site-packages/pipenv/core.py", line 1253, in do_init
[pipenv.exceptions.InstallError]:       pypi_mirror=pypi_mirror,
[pipenv.exceptions.InstallError]:   File "/home/ubuntu/.local/lib/python3.6/site-packages/pipenv/core.py", line 859, in do_install_dependencies
[pipenv.exceptions.InstallError]:       retry_list, procs, failed_deps_queue, requirements_dir, **install_kwargs
[pipenv.exceptions.InstallError]:   File "/home/ubuntu/.local/lib/python3.6/site-packages/pipenv/core.py", line 763, in batch_install
[pipenv.exceptions.InstallError]:       _cleanup_procs(procs, not blocking, failed_deps_queue, retry=retry)
[pipenv.exceptions.InstallError]:   File "/home/ubuntu/.local/lib/python3.6/site-packages/pipenv/core.py", line 681, in _cleanup_procs
[pipenv.exceptions.InstallError]:       raise exceptions.InstallError(c.dep.name, extra=err_lines)
[pipenv.exceptions.InstallError]: ['Collecting pyparsing==2.4.1 (from -r /tmp/pipenv-nfz65sbh-requirements/pipenv-11553m_x-requirement.txt (line 1))']
[pipenv.exceptions.InstallError]: ['ERROR: Could not find a version that satisfies the requirement pyparsing==2.4.1 (from -r /tmp/pipenv-nfz65sbh-requirements/pipenv-11553m_x-requirement.txt (line 1)) (from versions: 1.4.6, 1.4.7, 1.4.8, 1.4.11, 1.5.0, 1.5.1, 1.5.2, 1.5.3, 1.5.4, 1.5.5, 1.5.6, 1.5.7, 2.0.0, 2.0.1, 2.0.2, 2.0.3, 2.0.4, 2.0.5, 2.0.6, 2.0.7, 2.1.0, 2.1.1, 2.1.2, 2.1.3, 2.1.4, 2.1.5, 2.1.6, 2.1.7, 2.1.8, 2.1.9, 2.1.10, 2.2.0, 2.2.1, 2.2.2, 2.3.0, 2.3.1, 2.4.0, 2.4.1.1, 2.4.2a1)', 'ERROR: No matching distribution found for pyparsing==2.4.1 (from -r /tmp/pipenv-nfz65sbh-requirements/pipenv-11553m_x-requirement.txt (line 1))']

我之前处理过 pipenv 错误,大多数都非常合理(依赖项和子依赖项之间的冲突),但这对我来说意义不大,因为我没有专门安装这个包,而是 pipenv 将它添加到 pipfile 中。 lock 并且由于某种原因在本地该版本可用时,它不会一起找到该版本。

我也不知道哪个依赖项要求该特定版本。

Pipfile.lock 部分:

"pyparsing": {
            "hashes": [
                "sha256:530d8bf8cc93a34019d08142593cf4d78a05c890da8cf87ffa3120af53772238",
                "sha256:f78e99616b6f1a4745c0580e170251ef1bbafc0d0513e270c4bd281bf29d2800"
            ],
            "version": "==2.4.1"
        },

有什么想法吗?

编辑: 您可以在 pyparsing 的版本中看到该版本确实存在。看到它here

【问题讨论】:

  • 您是否检查过 pipenv 本身在您的本地计算机和服务器上是否具有相同的版本?我个人只使用 pip 安装软件包,当 pip 本身不是最新的时,您有时会遇到奇怪的错误 - 在更新 pip 并尝试再次安装相同的软件包后完全消失。
  • 它们实际上并不相同,所以我将 pipenv 和 pip 更新为最新的,所以全部匹配。还是不行
  • pyparsing 版本本身也发生了一些事情。在您最后链接的页面上,对于 2.4.1.1,它指出:“这是 2.4.1 版本的重新发布,以恢复 PyPI 中的发布历史,因为 2.4.1 版本已被删除。”
  • 该包可能已被意外删除。但是,由于这很容易通过再次重新上传来修复,因此更有可能存在一个非常糟糕的错误(比如开发人员密钥/密码,或者直接在代码中使用eval,这根本不应该是公开的.
  • 所有依赖于 pyparsing 的包(比如 scipy,在你的情况下),都有望更新它们对它的依赖(希望迟早),但这确实意味着会有 scipy 和导致此错误的其他软件包。理想情况下(在我看来),scipy 不应该修复 pyparsing 的错误修复版本,它只需要 pyparsing==2.4.* 并且 2.4.1 会自动替换为 2.4.1.1,但显然不是所以(显然,当对 '...==2.4.1' 有限制时,pip 版本解析不接受 2.4.1.1。

标签: python pip pipenv


【解决方案1】:

原来pyparsing删除了一个版本,真是奇怪。

我最终更新了一个包 (scipy),它将 pyparsing 更新到 2.4.1.1,现在可以正常工作了

【讨论】:

    猜你喜欢
    • 2018-02-01
    • 1970-01-01
    • 1970-01-01
    • 2015-07-22
    • 2019-04-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多