首页 > 解决方案 > 有关 OSError 的错误:libgsl.so.0 无法打开共享文件

问题描述

我一直在 ubuntu 上测试一个名为 Nano lambda SPR 的光谱仪。我只是按照他们的安装手册安装了 libusb-1.0.9 和 libusb-compat-1.0.4。他们的安装手册的链接与图片和安装说明在这里。我只是按照开头直接进入最后一页运行他们的 python 示例。现在我正在尝试运行他们的示例脚本之一。但是,我收到以下错误,我不确定 libgsl.so.0 是什么以及从哪里开始寻找解决此问题的方法。

**********************************************************************
[Python-3]        Python Version :  3 . 8  Detected
**********************************************************************
[PythonPrism] CrystalBase Library Loaded Successfully!
[PythonPrism] CrystalCorePath:  ../Libs/libCrystalCore.so
Traceback (most recent call last):
  File "example_wrapper_python.py", line 32, in <module>
    pSpecCore =   initialize_core_api("../Libs/libCrystalCore.so")
  File "../../../../wrappers/python/wrapper_python3/core/initialize_core_api.py", line 16, in initialize_core_api
    pSpecCore = ctypes.CDLL(crystal_core_library_path)
  File "/usr/lib/python3.8/ctypes/__init__.py", line 369, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: libgsl.so.0: cannot open shared object file: No such file or directory

我还点击了这个链接并运行了命令: sudo find / -name libgsl.so它给了我以下输出: /usr/local/lib/libgsl.so /usr/lib/x86_64-linux-gnu/libgsl.so

所以我然后用python设置LD_LIBRARY_PATH=/usr/local/libexport LD_LIBRARY_PATH运行脚本,但我仍然得到同样的错误。

我也跑sudo apt install libgsl-dev并安装了它。但错误仍然相同。

我还运行了以下命令ls -l /usr/local/lib/libgsl*并得到以下输出:

-rw-r--r-- 1 root root 23265766 /usr/local/lib/libgsl.a
-rw-r--r-- 1 root root  1893050 /usr/local/lib/libgslcblas.a
-rwxr-xr-x 1 root root      949 /usr/local/lib/libgslcblas.la
lrwxrwxrwx 1 root root       20 /usr/local/lib/libgslcblas.so -> libgslcblas.so.0.0.0
lrwxrwxrwx 1 root root       20 /usr/local/lib/libgslcblas.so.0 -> libgslcblas.so.0.0.0
-rwxr-xr-x 1 root root  1098776 /usr/local/lib/libgslcblas.so.0.0.0
-rwxr-xr-x 1 root root      918 /usr/local/lib/libgsl.la
lrwxrwxrwx 1 root root       16 /usr/local/lib/libgsl.so -> libgsl.so.25.0.0
lrwxrwxrwx 1 root root       16 /usr/local/lib/libgsl.so.25 -> libgsl.so.25.0.0
-rwxr-xr-x 1 root root 13525872 /usr/local/lib/libgsl.so.25.0.0

标签: pythonpython-3.xubuntu

解决方案


你谷歌这个吗?libgsl 是 Gnu 科学图书馆。如果您正在运行 Ubuntu,请执行sudo apt install libgsl-dev.


推荐阅读