python - 有关 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/lib
并export 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
解决方案
你谷歌这个吗?libgsl 是 Gnu 科学图书馆。如果您正在运行 Ubuntu,请执行sudo apt install libgsl-dev
.
推荐阅读
- node.js - 表单发布使 req.body.[输入名称] 未定义
- matlab - MATLAB fmincon 报告的 Hessian 矩阵,fminunc 是平均 Hessian Matrix 吗?
- python - 一次迭代两个 Pytorch 张量?
- java - 如何提交清单
> 到 ThreadPoolExecutor,每个线程将选择一个 LinkedBlockingQueue 并并行执行 - r - 获取“as.vector(x.mode)中的错误:无法将'closure'类型强制为'any'类型的向量”
- javascript - 用户名和密码的未定义索引回显测试
- sql-server - 如何从一台服务器连接切换到数据库引擎
- angular - 已发布的 Angular 库在 npmjs 上没有导入模块
- c# - 在另一个文本框中输入数据时,将 SQL Server 表中的数据添加到文本框中
- reactjs - 添加动态链接