ImportError: zstd C API versions mismatch 的参考解决方法

写在前面

自己的测试环境:
Ubuntu20.04
ROS-Noetic

一、问题描述

自己运行 python 程序时出现如下报错:

  File "/home/wong/.local/lib/python3.8/site-packages/evo/tools/file_interface.py", line 34, in <module>
    from rosbags.rosbag2 import (Reader as Rosbag2Reader, Writer as Rosbag2Writer)
  File "/home/wong/.local/lib/python3.8/site-packages/rosbags/rosbag2/__init__.py", line 11, in <module>
    from .reader import Reader
  File "/home/wong/.local/lib/python3.8/site-packages/rosbags/rosbag2/reader.py", line 11, in <module>
    import zstandard
  File "/home/wong/.local/lib/python3.8/site-packages/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 (10404 returned by the lib, 10502 hardcoded in zstd headers, 10502 hardcoded in the cext)

在这里插入图片描述

二、解决方法

出现上述版本的原因是 zstandard 或者 zstd 未安装,或者版本太老了。重新安装zstandard 或者 zstd 即可解决问题。

pip install --force-reinstall zstandard zstd

然后再次执行 python 程序即可。

参考链接

[1] PHPirate. Conda not working after reinstall - zstandard issue [EB/OL]. https://stackoverflow.com/questions/76266770/conda-not-working-after-reinstall-zstandard-issue, 2023-10-22/2024-08-26.

  • 4
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值