sbslee / dokdo

A Python package for microbiome sequencing analysis with QIIME 2
https://dokdo.readthedocs.io
MIT License
42 stars 12 forks source link

ImportError: libhdf5_cpp.so.200: cannot open shared object file: No such file or directory #48

Closed yonghyun09 closed 1 year ago

yonghyun09 commented 1 year ago

Hi @sbslee One day while I was using the library, the following error occurred during the import process. Could you please ask for help on this? Error codes generated during import are attached as follows.

ImportError Traceback (most recent call last) Cell In [13], line 1 ----> 1 import dokdo

File ~/dokdo/dokdo/init.py:1 ----> 1 from .api import *

File ~/dokdo/dokdo/api/init.py:2 1 from .common import get_mf, pname ----> 2 from .ordinate import ordinate 3 from .num2sig import num2sig 4 from .wilcoxon import wilcoxon

File ~/dokdo/dokdo/api/ordinate.py:3 1 from qiime2 import Artifact 2 from qiime2 import Metadata ----> 3 from qiime2.plugins import diversity_lib 4 from qiime2.plugins import feature_table 5 from qiime2.plugins import diversity

File ~/miniconda/envs/qiime2-2022.2/lib/python3.8/site-packages/qiime2/plugins.py:425, in QIIMEArtifactAPIImporter.find_spec(self, name, path, target) 422 plugin_details = fqn[2:] # fqn[len(['qiime2', 'plugins']):] 423 plugin_name = plugin_details[0] --> 425 plugin = self._plugin_lookup(plugin_name) 426 if plugin is None or len(plugin_details) > 2: 427 return None

File ~/miniconda/envs/qiime2-2022.2/lib/python3.8/site-packages/qiime2/plugins.py:402, in QIIMEArtifactAPIImporter._plugin_lookup(self, plugin_name) 400 def _plugin_lookup(self, pluginname): 401 import qiime2.sdk --> 402 pm = qiime2.sdk.PluginManager() 403 lookup = {s.replace('-', ''): s for s in pm.plugins} 404 if plugin_name not in lookup:

File ~/miniconda/envs/qiime2-2022.2/lib/python3.8/site-packages/qiime2/sdk/plugin_manager.py:67, in PluginManager.new(cls, add_plugins) 65 cls.__instance = self 66 try: ---> 67 self._init(add_plugins=add_plugins) 68 except Exception: 69 cls.__instance = None

File ~/miniconda/envs/qiime2-2022.2/lib/python3.8/site-packages/qiime2/sdk/plugin_manager.py:105, in PluginManager._init(self, add_plugins) 103 project_name = entry_point.dist.project_name 104 package = entry_point.module_name.split('.')[0] --> 105 plugin = entry_point.load() 107 self.add_plugin(plugin, package, project_name, 108 consistency_check=False) 110 self._consistency_check()

File ~/miniconda/envs/qiime2-2022.2/lib/python3.8/site-packages/pkg_resources/init.py:2465, in EntryPoint.load(self, require, *args, *kwargs) 2463 if require: 2464 self.require(args, **kwargs) -> 2465 return self.resolve()

File ~/miniconda/envs/qiime2-2022.2/lib/python3.8/site-packages/pkg_resources/init.py:2471, in EntryPoint.resolve(self) 2467 def resolve(self): 2468 """ 2469 Resolve the entry point from its module and attrs. 2470 """ -> 2471 module = import(self.module_name, fromlist=['name'], level=0) 2472 try: 2473 return functools.reduce(getattr, self.attrs, module)

File ~/miniconda/envs/qiime2-2022.2/lib/python3.8/site-packages/q2_diversity_lib/plugin_setup.py:18 15 from q2_types.distance_matrix import DistanceMatrix 16 from unifrac._meta import CONSOLIDATIONS ---> 18 from . import alpha, beta, version 20 citations = Citations.load('citations.bib', package='q2_diversity_lib') 21 plugin = Plugin( 22 name="diversity-lib", 23 version=version, (...) 28 " community alpha and beta diversity.", 29 )

File ~/miniconda/envs/qiime2-2022.2/lib/python3.8/site-packages/q2_diversity_lib/beta.py:12 10 import skbio.diversity 11 import sklearn.metrics ---> 12 import unifrac 13 from skbio.stats.composition import clr 14 from scipy.spatial.distance import euclidean

File ~/miniconda/envs/qiime2-2022.2/lib/python3.8/site-packages/unifrac/init.py:30 9 import pkg_resources 11 from unifrac._methods import (unweighted, 12 weighted_normalized, 13 weighted_unnormalized, (...) 28 h5unifrac, 29 h5pcoa) ---> 30 from unifrac._api import ssu, faith_pd, ssu_to_file 33 version = pkg_resources.get_distribution('unifrac').version 34 all = ['unweighted', 'weighted_normalized', 'weighted_unnormalized', 35 'generalized', 'unweighted_fp32', 'weighted_normalized_fp32', 36 'weighted_unnormalized_fp32', 'generalized_fp32', (...) 44 'h5unifrac', 'h5pcoa', 45 'ssu', 'faith_pd', 'ssu_to_file']

ImportError: libhdf5_cpp.so.200: cannot open shared object file: No such file or directory

sbslee commented 1 year ago

@yonghyun09,

Thanks for the question. That's some weird error that I have not encountered before. Can you show me the output of the command $ conda list in your QIIME 2 environment?

Alternatively, I suggest that you try again after creating a new fresh conda environment for QIIME2 and Dokdo. Have you tried this?

yonghyun09 commented 1 year ago

@sbslee

thank you After a lot of various attempts, I confirmed that the problem was solved when I rebuilt the qiime2 and conda environment as you said. As a guess as to the cause of the problem, it seems that these errors were caused by changes caused by recent updates to conda and qiime. https://forum.qiime2.org/t/qiime-2022-8-install-broken-on-linux-incorrect-hdf5-versions/24260/6

The virtual machine I was using was 2022.2 qiime2 core, but I guess it might have happened because it was not compatible with that version of qiime while updating the latest conda. Accordingly, I reset the settings to the previous version, and it worked normally.

It seems that I am going through this inconvenience because I am using a virtual machine with a Windows computer, but I think I need to come up with a good solution. Thank you for your kind reply.

이승빈님께,

감사합니다. 수많은 다양한 시도 끝에, 말씀하신 것 처럼 qiime2 및 conda 환경을 재구축했을때 현상이 해결되는 것을 확인했습니다. 문제의 원인에 대한 추정으로는 아무래도 최근 conda 및 qiime의 업데이트로 인해 변경사항들이 발생하여 이러한 에러가 생겼던 것 같습니다. 제가 사용하고 있는 가상머신은 2022.2 qiime2 core였는데, 최신 conda를 업데이트하면서 해당 버전의 qiime과 호환이 안되어 발생하지 않았을까 추측해봅니다. 이에 따라 이전 버전으로 세팅을 다시 했는데, 정상적으로 작동하였습니다. 윈도우 컴퓨터로 가상머신을 사용하고 있어 이런 불편함을 거치게 되는 것 같은데, 해결책을 잘 마련해야할 것 같습니다.

친절히 답변해주셔서 감사합니다.

이용현 드림.