我在hmmlearn
正确安装软件包时遇到了一些麻烦(在虚拟环境中);它似乎与底层 C 代码有关。该软件包可以正常安装pip
,但是当我尝试导入核心类时,出现错误:
In [1]: import hmmlearn
In [2]: from hmmlearn import hmm
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-2-8b8c029fb053> in <module>()
----> 1 from hmmlearn import hmm
/export/hdi3/home/krono/envs/sd/lib/python2.7/site-packages/hmmlearn/hmm.py in <module>()
19 from sklearn.utils import check_random_state
20
---> 21 from .base import _BaseHMM
22 from .utils import iter_from_X_lengths, normalize
23
/export/hdi3/home/krono/envs/sd/lib/python2.7/site-packages/hmmlearn/base.py in <module>()
11 from sklearn.utils.validation import check_is_fitted
12
---> 13 from . import _hmmc
14 from .utils import normalize, log_normalize, iter_from_X_lengths
15
ImportError: /export/hdi3/home/krono/envs/sd/lib/python2.7/site-packages/hmmlearn/_hmmc.so: undefined symbol: npy_expl
我一直在阅读关于 SO 的其他问题,这些问题似乎可以解决这个问题,但是一种解决方案(使用 Anaconda)将不起作用,因为hmmlearn
不包括在内。似乎答案与编译 C 代码有关,但我不确定如何去做。任何帮助将非常感激!