【问题标题】:python parquet install fails on macos with snappy and thiftpypython parquet install 在带有 snappy 和 thiftpy 的 macos 上失败
【发布时间】:2019-08-27 21:21:06
【问题描述】:

我对 python 比较陌生。我需要具有适度磁盘要求的快速 IO 格式。羽毛缺乏压缩力,所以是镶木地板。我尝试安装

sudo pip3 install parquet

在 macOS 10.14.6、Python 3.7.4、pip 19.1.1 上。

第一组错误与 snappy 有关。它们可以用brew install snappysudo pip3 install snappy 修复。 (问:pip3 是否不能自动找出并满足依赖关系,或者至少指示如何解决这个问题?)

但是,我运气不好:

...
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -I/usr/local/include -I/usr/local/opt/openssl/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/python/3.7.4/Frameworks/Python.framework/Versions/3.7/include/python3.7m -c thriftpy/transport/cybase.c -o build/temp.macosx-10.14-x86_64-3.7/thriftpy/transport/cybase.o
thriftpy/transport/cybase.c:3127:24: error: no member named 'exc_type' in 'struct _ts'
    tmp_type = tstate->exc_type;
               ~~~~~~  ^
thriftpy/transport/cybase.c:3128:25: error: no member named 'exc_value' in 'struct _ts'; did you mean 'curexc_value'?
    tmp_value = tstate->exc_value;
                        ^~~~~~~~~
                        curexc_value
...

瓦迪斯?

【问题讨论】:

    标签: python parquet


    【解决方案1】:

    parquet 软件包未维护且已过时。要在 Python 中读写 Parquet 文件,您应该安装 pyarrow 并使用 pyarrow.parquet 模块。

    当您安装了pyarrowpandas 后,您还可以将pandas 的Parquet 功能与pandas.read_parquetpandas.DataFrame.to_parquet 一起使用,以方便使用。

    【讨论】:

    • 可以去掉吗?我可能不是第一个偶然发现镶木地板和快速镶木地板然后想知道为什么没有任何效果的人......
    • fastparquet 也应该可以工作。从 PyPI 中删除包虽然是非常值得讨论的事情,但在 discuss.python.org 上可能会更好地讨论
    • 如果您需要“snappy”,fastparquet 将无法工作,因为“python-snappy”无法在 MacOS 中构建
    猜你喜欢
    • 2021-03-31
    • 2022-10-02
    • 2021-09-01
    • 2018-06-03
    • 2015-08-21
    • 2020-03-26
    • 2021-05-22
    • 2019-07-06
    • 1970-01-01
    相关资源
    最近更新 更多