ImportError: zstd C API versions mismatch; Python bindings were not compiled/linked against expected zstd version (10409 returned by the lib, 10409 hardcoded in zstd headers, 10408 hardcoded in the cext)
メンテナーはふだん 10 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
python setup.py build --system-zstd と、示されている import コマンドを使って失敗を再現します。まず、c-ext/backend_c.c、build/zstandard/_cffi.c、zstd/zstdlib.c、およびシステムの zstd ヘッダーにあるバージョンの情報源を比較します。ビルドされた Python バインディングが C API のバージョン不一致なしに正常に import できれば完了です。
索引モデルが issue の本文から書いたものです。
説明
I get the following error when I try to use just-built C extension against system zstd:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/python-zstandard/build/lib.linux-x86_64-3.9/zstandard/__init__.py", line 39, in <module>
from .backend_c import * # type: ignore
ImportError: zstd C API versions mismatch; Python bindings were not compiled/linked against expected zstd version (10409 returned by the lib, 10409 hardcoded in zstd headers, 10408 hardcoded in the cext)
This is how I built it:
$ python setup.py build --system-zstd
generating build/zstandard/_cffi.c
regenerated: 'build/zstandard/_cffi.c'
running build
running build_py
creating build/lib.linux-x86_64-3.9
creating build/lib.linux-x86_64-3.9/zstandard
copying zstandard/backend_cffi.py -> build/lib.linux-x86_64-3.9/zstandard
copying zstandard/__init__.py -> build/lib.linux-x86_64-3.9/zstandard
copying zstandard/__init__.pyi -> build/lib.linux-x86_64-3.9/zstandard
copying zstandard/py.typed -> build/lib.linux-x86_64-3.9/zstandard
running build_ext
building 'zstandard.backend_c' extension
creating build/temp.linux-x86_64-3.9
creating build/temp.linux-x86_64-3.9/c-ext
x86_64-pc-linux-gnu-gcc-10.2.0 -pthread -fPIC -Ic-ext -I/usr/include/python3.9 -c c-ext/backend_c.c -o build/temp.linux-x86_64-3.9/c-ext/backend_c.o -DZSTD_MULTITHREAD
x86_64-pc-linux-gnu-gcc-10.2.0 -pthread -shared -Wl,-O1 -Wl,--as-needed -Wl,--hash-style=gnu build/temp.linux-x86_64-3.9/c-ext/backend_c.o -L/usr/lib64 -lzstd -o build/lib.linux-x86_64-3.9/zstandard/backend_c.cpython-39-x86_64-linux-gnu.so
building 'zstandard._cffi' extension
creating build/temp.linux-x86_64-3.9/build
creating build/temp.linux-x86_64-3.9/build/zstandard
creating build/temp.linux-x86_64-3.9/zstd
x86_64-pc-linux-gnu-gcc-10.2.0 -pthread -fPIC -I/tmp/python-zstandard/zstd -I/tmp/python-zstandard/zstd/dictBuilder -I/usr/include/python3.9 -c build/zstandard/_cffi.c -o build/temp.linux-x86_64-3.9/build/zstandard/_cffi.o
x86_64-pc-linux-gnu-gcc-10.2.0 -pthread -fPIC -I/tmp/python-zstandard/zstd -I/tmp/python-zstandard/zstd/dictBuilder -I/usr/include/python3.9 -c zstd/zstdlib.c -o build/temp.linux-x86_64-3.9/zstd/zstdlib.o
x86_64-pc-linux-gnu-gcc-10.2.0 -pthread -shared -Wl,-O1 -Wl,--as-needed -Wl,--hash-style=gnu build/temp.linux-x86_64-3.9/build/zstandard/_cffi.o build/temp.linux-x86_64-3.9/zstd/zstdlib.o -L/usr/lib64 -o build/lib.linux-x86_64-3.9/zstandard/_cffi.cpython-39-x86_64-linux-gnu.so
$ cd build/lib.linux-x86_64-3.9/
$ python -c 'import zstandard.backend_c'
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/python-zstandard/build/lib.linux-x86_64-3.9/zstandard/__init__.py", line 39, in <module>
from .backend_c import * # type: ignore
ImportError: zstd C API versions mismatch; Python bindings were not compiled/linked against expected zstd version (10409 returned by the lib, 10409 hardcoded in zstd headers, 10408 hardcoded in the cext)
I can reproduce this with git master @ 477776e6019478ca1c0b5777b073afbec70975f5
- 主要言語
- C
- スター
- 642
- フォーク
- 118
- 平均マージ
- 9日 3時間
- マージ済み PR(30日)
- 6
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
indygreg/python-zstandard のほかの issue
-
`multi_decompress_to_buffer([])` terminates the process with SIGFPE対応中かも @mikamikasuki が 15 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
indygreg/python-zstandard#335 ·
メンテナーはふだん 10 日以内に返信
-
Silent data-correctness bug: `readinto()` / `readinto1()` on `stream_reader` return `tell() == 0` after successful reads対応中かも @CAOShurong が 9 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
indygreg/python-zstandard#295 ·
メンテナーはふだん 10 日以内に返信
-
CFFI backend: crash when ZstdDecompressor instances share a ZstdCompressionDict対応中かも @pylaterreur が 1 日前に担当しました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
indygreg/python-zstandard#361 ·
メンテナーはふだん 10 日以内に返信
-
Python 3.15 wheels対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 55/100
indygreg/python-zstandard#354 · リアクション 1 件 ·
メンテナーはふだん 10 日以内に返信
-
`estimated_compression_context_size()` raises SIGFPE with `enable_ldm=True対応中かも @yousefissa が 3 日前に担当しました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 64/100
indygreg/python-zstandard#345 ·
メンテナーはふだん 10 日以内に返信
indygreg/python-zstandard の issue をすべて見る
似ている issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 72/100
AFLplusplus/AFLplusplus#2903 ·
-
category:port-update
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 90/100
colbymchenry/codegraph#2634 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
メンテナーはふだん 8 日以内に返信