【问题标题】:pip3 Install delta-lake-reader[aws] fails on MacOS Mojavepip3 在 MacOS Mojave 上安装 delta-lake-reader [aws] 失败
【发布时间】:2021-07-05 21:25:25
【问题描述】:

我正在尝试在装有 MacOS Mojave 的 MacBook Pro 上安装 delta-lake-reader[aws],但它失败了。我的笔记本电脑上安装了 Python 3.9.1。

$ pip3 install delta-lake-reader[aws]


Collecting delta-lake-reader[aws]
  Using cached delta_lake_reader-0.2.2-py3-none-any.whl (7.4 kB)
Collecting pyarrow<3.0.0,>=2.0.0
  Using cached pyarrow-2.0.0.tar.gz (58.9 MB)
  Installing build dependencies ... |

之后它挂了一段时间,然后失败并出现很多错误,最后在结束前给出以下输出:

ERROR: Cannot install delta-lake-reader[aws]==0.1.0, delta-lake-reader[aws]==0.1.1, delta-lake-reader[aws]==0.2.1 and delta-lake-reader[aws]==0.2.2 because these package versions have conflicting dependencies.

The conflict is caused by:
    delta-lake-reader[aws] 0.2.2 depends on pyarrow<3.0.0 and >=2.0.0
    delta-lake-reader[aws] 0.2.1 depends on pyarrow<3.0.0 and >=2.0.0
    delta-lake-reader[aws] 0.1.1 depends on pyarrow<3.0.0 and >=2.0.0
    delta-lake-reader[aws] 0.1.0 depends on pyarrow<3.0.0 and >=2.0.0

To fix this you could try to:
1. loosen the range of package versions you've specified
2. remove package versions to allow pip attempt to solve the dependency conflict

ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/user_guide/#fixing-conflicting-dependencies
$

我尝试卸载 pyarrow,但它再次安装 3.0.0 并以同样的方式失败。

我该如何克服这个问题?

【问题讨论】:

    标签: python-3.x amazon-s3 pyarrow delta-lake


    【解决方案1】:

    问题在于显式依赖,不包括 pyarrow 3.0.0,但需要 2.x.x 版本。并且 pyarrow 2.x.x 与 Python 3.9 不兼容,这就是您构建失败的原因,但它适用于 Python 3.8,我能够使用 pip3.8 install 'delta-lake-reader[aws]==0.2.2' 安装它。所以你有以下选择:

    • 使用 Python 3.8
    • 下载存储库,并在pyproject.toml 中进行更改以使用pyarrow 3.0.0,然后使用poetry tool 构建轮子
    • project 中的文件问题,等待作者修复。
    • 如果你不需要额外的功能,那么你可以使用官方的Delta Lake python package,可以通过pip install deltalake命令安装

    【讨论】:

    • 感谢@Alex Ott 及时详细的回复。我想要 Python 3.8 的原因有很多,包括这个。在 MacOS 上卸载 3.9 和安装 3.8 是一项复杂的工作吗?我还有其他库,如 Boto3 等,VS Code 与这个版本捆绑在一起。如果我可以卸载 3.9 并安装 3.8,我可以重新安装。我的 mac 上的 Python 文件夹 /usr/bin/python/usr/local/bin/python3 分别用于 Python 2.7 和 2.9。
    • 这取决于它的安装方式。我认为您可以在自制软件中选择特定版本作为默认版本
    • 啊,好的——3.9是系统python。我认为您可以通过自制软件安装 python 3.8,并将其设为默认值而不是 3.9 - 请参阅此处的答案:stackoverflow.com/questions/60453261/…
    • 我刚刚查看了您在上次评论中给我的链接中的所有解决方案,但不确定哪个对我来说更安全。问题发布者那里接受的解决方案来自discourse.brew.sh/t/…。我也回顾了那个讨论。 pyenv 是另一种选择。我知道,这是一个不同的问题,但我觉得你可以建议我一个更安全的选择。
    • 这真的取决于你的工作流程。我个人会按照自制说明进行
    猜你喜欢
    • 2018-12-12
    • 2019-03-27
    • 2019-08-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-02-05
    • 2020-05-30
    • 2019-07-11
    相关资源
    最近更新 更多