解决python 导入 hmmlearn的hmm出错问题

python 3.85 通过pip install 安装好hmmlearn后,   from hmmearn import hmm时报错:

Python 3.8.5 (default, Sep  3 2020, 21:29:08) [MSC v.1916 64 bit (AMD64)] ::
conda, Inc. on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import hmmlearn
>>> from hmmlearn import hmm
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "D:\anaconda3\lib\site-packages\hmmlearn\hmm.py", line 16, in <module
    from .base import BaseHMM
  File "D:\anaconda3\lib\site-packages\hmmlearn\base.py", line 11, in <modul
    from . import _hmmc, _utils
ImportError: DLL load failed while importing _hmmc: 找不到指定的模块。
>>>

网上查了半天发现也没有特别好的解决方法, 尝试pip uninstall 后再重装,再重启,都不能解决.  最后怀疑是不是python 3.85版本的问题,或者是当前环境包太多有冲突造成的. 不过实在懒得逐项查找排除问题, 干脆就另建了一个Python 3.8.13的环境, 再次安装hmmlearn包后, 果然成功导入hmm模块:

Python 3.8.13 | packaged by conda-forge | (default, Mar 25 2022, 05:59:00) [MSC
v.1929 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import hmmlearn
>>> from hmmlearn import hmm
>>>

填个小坑, 分享给有需要的小伙伴, 谢赞...

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值