ImportError: dlopen: cannot load any more object with static TLS It seems that scikit-image has not

错误代码如下

ImportError: dlopen: cannot load any more object with static TLS
It seems that scikit-image has not been built correctly.

Your install of scikit-image appears to be broken.
Try re-installing the package following the instructions at:
https://scikit-image.org/docs/stable/install.html

使用linux服务器运行github上面的某些代码,运行demo.py出现了如上错误。

解决方法

注:本文提供的是我运行代码出现错误的解决方法,并不一定适用其他代码。但是你可以尝试一下。

代码我在windows11上跑了没啥问题,在WSL中也跑了,也没啥问题。就是在linux服务器上跑才出现了问题。
首先我不是服务器的root用户,升级gcc和glibc好难搞啊,我没有升级。
我也更改scikit-image了好几个版本,还是会报这个错误。

服务器是Centos的。通过ldd --version命令查看,ldd (GNU libc) 2.18。可以通过如下方式解决我的问题。

最终我的解决方法:
我在代码的demo.py中导入了scikit-image包。增加的代码是:

import skimage

通过导入skimage包,我的问题得到了解决。如果我把这行代码注释掉,就又会出现上述错误,至此,我得出了结论,确实是这个问题导致的。

猜你喜欢

转载自blog.csdn.net/qq_36693723/article/details/129022899