python hmmlearn中导入错误

时间:2017-02-05 09:25:36

标签: python hmmlearn

我正在尝试安装python hmmlearn库来构建连续的HMM。我已经安装了GitHub中的所有依赖项和hmmlearn库。安装成功完成。

...
Processing dependencies for hmmlearn==0.2.1
Searching for scikit-learn==0.18.1
Best match: scikit-learn 0.18.1
Adding scikit-learn 0.18.1 to easy-install.pth file
Using /usr/local/lib/python2.7/dist-packages
Finished processing dependencies for hmmlearn==0.2.1

但是在python中,当我尝试使用

导入GaussianHMM时
from hmmlearn.hmm import GaussianHMM

它会导致一些导入错误:

 Traceback (most recent call last):
 File "<stdin>", line 1, in <module>
 File "hmmlearn/hmm.py", line 22, in <module>
 from .base import _BaseHMM
 File "hmmlearn/base.py", line 13, in <module>
 from . import _hmmc
 ImportError: cannot import name _hmmc

1 个答案:

答案 0 :(得分:1)

问题在于hmmlearn / setup.py,它没有将utils列为子模块。

将此行添加到setup.py grep("b", x, value = TRUE, invert = TRUE) #[1] "a"

config.add_subpackage("utils")