2017-02-05 30 views
0

私は、Python hmmlearnライブラリをインストールして、継続的なHMMを構築しようとしています。私はGitHubからすべての依存関係とhmmlearnライブラリをインストールしました。インストールが正常に完了しました。python 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で、私は

from hmmlearn.hmm import GaussianHMM 

を使用して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

問題は「doesnのhmmlearn/setup.pyでありますサブモジュールとしてutilsをリストします。

setup.pyのためにこの行を追加します。config.add_subpackage("utils")

@@ -18,7 +18,7 @@ def configuration(parent_package='', top_path=None): 
     include_dirs=[numpy.get_include()], 
     libraries=libraries, 
    ) 
- 
+ config.add_subpackage("utils") 
    return config 

if __name__ == '__main__': 
関連する問題