You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

导入google.cloud.storage模块时出现libprotobuf.so.23.1.0错误如何解决?

解决ImportError: libprotobuf.so.23.1.0: cannot open shared object file: No such file or directory问题

步骤1:检查protobuf版本匹配度

  • 执行protoc --version查看系统已安装的protobuf版本,确认是否为23.1.0。如果版本不符,需要调整到对应版本。

步骤2:重装对应版本的protobuf

  • 先卸载现有Python protobuf包:pip uninstall -y protobuf
  • 安装指定的23.1.0版本:pip install protobuf==23.1.0
  • 若为Linux系统且系统级libprotobuf缺失:
    • Debian/Ubuntu系:执行sudo apt-get install libprotobuf-dev=3.23.1-1(注意版本对应,找不到的话可尝试更新源或从官方编译安装)
    • RHEL/CentOS系:执行sudo yum install protobuf-devel-23.1.0(需确保仓库中有对应版本包)

步骤3:配置库路径

  • 定位libprotobuf.so.23.1.0的位置:find / -name libprotobuf.so.23.1.0 2>/dev/null
  • 将找到的路径添加到环境变量:export LD_LIBRARY_PATH=/找到的路径:$LD_LIBRARY_PATH(临时生效,永久生效可写入~/.bashrc或~/.profile文件)

步骤4:重装google-cloud-storage

  • 卸载后重装以修复依赖关联:pip uninstall -y google-cloud-storage && pip install google-cloud-storage

内容的提问来源于stack exchange,提问作者KBurchfiel

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.20 01:44:59