简体   繁体   English

库未加载:@rpath/libhdf5.103.dylib 导入 scanpy 和表时

[英]Library not loaded: @rpath/libhdf5.103.dylib when importing scanpy and tables

I've installed scanpy and all the necessary associated packages in PyCharm (tables, numpy, etc.), but when I try to import scanpy, I receive the following error:我已经在 PyCharm(表格、numpy 等)中安装了 scanpy 和所有必要的相关包,但是当我尝试导入 scanpy 时,我收到以下错误:

ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/tables/utilsextension.cpython-39-darwin.so, 2): Library not loaded: @rpath/libhdf5.103.dylib
  Referenced from: /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/tables/utilsextension.cpython-39-darwin.so
  Reason: image not found

The same error appears when I try importing tables, so it seems this is more fundamentally an issue with importing that package (which scanpy is dependent on).当我尝试导入表时出现同样的错误,所以这似乎是导入 package(scanpy 所依赖的)的根本问题。 I've tried uninstalling and reinstalling scanpy and tables, as well as PyCharm itself, and I'm continuing to receive this error.我已经尝试卸载并重新安装 scanpy 和 tables,以及 PyCharm 本身,但我仍然收到此错误。

I'm new to this and honestly not even sure how to interpret the error message above or approach this issue.我是新手,老实说,我什至不确定如何解释上面的错误消息或解决这个问题。 Should libhdf5.103.dylib be stored somewhere else? libhdf5.103.dylib 应该存储在其他地方吗? It looks like libhdf5.103.dylib currently exists under usr > opt > anaconda3 > lib on my computer.看起来 libhdf5.103.dylib 当前存在于我的计算机上的 usr > opt > anaconda3 > lib 下。 Is something else the issue?还有其他问题吗?

I had the same issue.我遇到过同样的问题。 Installing pytables from conda solved the issue从 conda 安装 pytables 解决了这个问题

conda install -c anaconda pytables

I then installed scanpy using pip然后我使用 pip 安装了 scanpy

The trick from Neuronur work. Neuronur 工作的技巧。 In case you want to save some of your storage, the underlying way to make it work is to create the symlink in your environment: ln -s /Users/yourLocalUserName/miniconda3/envs/your_envs_name/lib/libhdf5.dylib /Users/yourLocalUserName/miniconda3/envs/your_envs_name/lib/libhdf5.103.dylib如果您想节省一些存储空间,使其工作的基本方法是在您的环境中创建符号链接: ln -s /Users/yourLocalUserName/miniconda3/envs/your_envs_name/lib/libhdf5.dylib /Users/yourLocalUserName/miniconda3/envs/your_envs_name/lib/libhdf5.103.dylib

ln -s /Users/yourLocalUserName/miniconda3/envs/your_envs_name/lib/libhdf5_cpp.dylib /Users/yourLocalUserName/miniconda3/envs/your_envs_name/lib/libhdf5_cpp.103.dylib

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM