python - python parquet install 在 macos 上使用 snappy 和 thiftpy 失败
问题描述
我对python比较陌生。我需要具有适度磁盘要求的快速 IO 格式。羽毛缺乏压缩力,所以是镶木地板。我试图安装
sudo pip3 install parquet
在 macOS 10.14.6、Python 3.7.4、pip 19.1.1 上。
第一组错误与 snappy 有关。它们可以用brew install snappy
和固定sudo 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
...
夸瓦迪斯?
解决方案
该parquet
软件包未维护且已过时。要在 Python 中读取和写入 Parquet 文件,您应该安装pyarrow
并使用该pyarrow.parquet
模块。
安装pyarrow
并pandas
安装后,您还可以方便地使用Parquetpandas
功能。pandas.read_parquet
pandas.DataFrame.to_parquet
推荐阅读
- javascript - 访问组件的“key”道具
- sql - 在 Oracle SQL 中对行进行分组以实现唯一 ID
- java - EmbeddedKafkaRule 没有 brokerListProperty 方法
- python - 我如何从烧瓶中传递变量)o没有渲染模板的HTML?
- python - 机器学习:如何找到缺失的信息
- python - python中的字典字典
- rest - HTTP标头的“资源”和“方法”有什么区别?
- php - 正则表达式与括号不匹配
- regex - 要丢弃的正则表达式“
- python - 修复 UnboundLocalError:在 python 中赋值之前引用的局部变量“名称”