OSError: libstdc++.so.6: cannot open shared object file: No such file or directory以及相关问题解决攻略

报错OSError: libstdc++.so.6: cannot open shared object file: No such file or directory

安装libstdc++.so.6

sudo apt-get install libstdc++6

出现如图报错
在这里插入图片描述
出现上图报错,接着输入指令

sudo ldconfig

这个时候再重新执行上面的那条安装指令即可成功

sudo apt-get install libstdc++6

在这里插入图片描述

报错ImportError: /lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.29’ not found (required by /home/cxh/miniconda3/envs/swinGrasp/lib/python3.8/site-packages/kiwisolver/_cext.cpython-38-x86_64-linux-gnu.so)

参考其他博主的帖子解决,链接: 出现libstdc++.so.6问题的解决办法
发现我们的环境确实没有GLIBCXX_3.4.29

strings /usr/lib/x86_64-linux-gnu/libstdc++.so.6 | grep GLIBCXX

在这里插入图片描述

sudo find / -name "libstdc++.so.6*"

在这里插入图片描述

发现存在我们想要的libstdc++.so.6.0.29,所在路径为/home/cxh/miniconda3/lib/libstdc++.so.6.0.29
执行指令

strings /home/cxh/miniconda3/lib/libstdc++.so.6.0.29 | grep GLIBCXX

输出的结果如下,可以发现里面有我们需要的版本3.4.29
在这里插入图片描述
按着参考的帖子,执行,将此处的文件拷贝到我们需要的文件夹内,删除原来的链接,并建立起新的链接

cp /home/cxh/miniconda3/lib/libstdc++.so.6.0.29 /usr/lib/x86_64-linux-gnu/
rm /usr/lib/x86_64-linux-gnu/libstdc++.so.6
ln -s /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.29 /usr/lib/x86_64-linux-gnu/libstdc++.so.6

报错AttributeError: module ‘numpy’ has no attribute ‘float’.

np.float was a deprecated alias for the builtin float. To avoid this error in existing code, use float by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use np.float64 here.
The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:
https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations

参考网上解决办法,链接: 重新安装匹配的numpy版本
我们一开始按照帖子是安装numpy==1.23.5发现依然报同样的错误,于是再往下降版本1.23.4管用了,不再报这个错!!!

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值