Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImportError: No module named mkl #141

Closed
wpenter opened this issue Oct 10, 2018 · 12 comments
Closed

ImportError: No module named mkl #141

wpenter opened this issue Oct 10, 2018 · 12 comments

Comments

@wpenter
Copy link

wpenter commented Oct 10, 2018

你好,在Macbook上运行main.py出现了一个问题,下载了依赖mkl,还是出现这个:

/usr/local/bin/python2.7 /Users/feanlau/Desktop/RecQ/main/main.py
Traceback (most recent call last):
  File "/Users/feanlau/Desktop/RecQ/main/main.py", line 3, in <module>
    from RecQ import RecQ
  File "/Users/feanlau/Desktop/RecQ/main/RecQ.py", line 9, in <module>
    import mkl
ImportError: No module named mkl

Process finished with exit code 1

jietu20181010-145943

请问一下,这个问题如何解决

@wpenter
Copy link
Author

wpenter commented Oct 10, 2018

补充说明一下:在Windows的电脑上也有这个问题的 ​​​​

@wpenter
Copy link
Author

wpenter commented Oct 10, 2018

3

@Coder-Yu
Copy link
Owner

Coder-Yu commented Oct 10, 2018

你是用的anaconda吗?还是原生的python2.7

@wpenter
Copy link
Author

wpenter commented Oct 10, 2018

你好,我用的是原生Python2.7,用pycharm作为编辑器的。我刚刚在anaconda运行成功了程序。那请问在原生的Python2.7环境下,是不是要研究安装mkl扩展,才能运行程序的?

@Coder-Yu
Copy link
Owner

推荐直接用Anaconda吧,基本上自己不用安装包,只要不运行基于tensorflow的算法。mkl我之前有弄过,但过了很久了忘了有没有遇到什么问题,不好意思

@wpenter
Copy link
Author

wpenter commented Oct 11, 2018

非常感谢您的回复!

@bbjy
Copy link

bbjy commented Feb 28, 2019

你好,请问我在Ubuntu系统下安装了anaconda,然后为这个项目创建了专门的虚拟环境Python版本是2.7.13,并且pip install mkl成功,但是import mkl的时候还是出现了“ImportError: No module named mkl”的错误,但是如果非这个虚拟环境下我的Python版本对应的是3.5,可以成功import mkl,请问你有遇到过吗?你知道这可能是什么问题吗?谢谢! @feanlau

@Coder-Yu
Copy link
Owner

@bbjy 无需额外安装python 原生版,直接用anconda的bin目录下的python运行即可,不会遇到import error。部分算法需要tensorflow建议安装

@bbjy
Copy link

bbjy commented Mar 1, 2019

@Coder-Yu 感谢您的回复!但是我这边还是没能成功,因为我的anaconda里面的Python是Python3,所以才创建RecQ虚拟环境并指定Python=2.7,但是在Python2.7这个环境里就没能成功安装mkl,只有Python3的环境里有。我再试着弄一下吧,谢谢您!

@Coder-Yu
Copy link
Owner

Coder-Yu commented Mar 1, 2019

@Coder-Yu 感谢您的回复!但是我这边还是没能成功,因为我的anaconda里面的Python是Python3,所以才创建RecQ虚拟环境并指定Python=2.7,但是在Python2.7这个环境里就没能成功安装mkl,只有Python3的环境里有。我再试着弄一下吧,谢谢您!

我建议还是再安装一个anaconda2的环境吧。很简单就解决问题了,为什么一定要弄虚拟环境呢。

@bbjy
Copy link

bbjy commented Mar 2, 2019

@Coder-Yu 嗯,我也准备这么解决了,谢谢您!

@mztkenan
Copy link

mztkenan commented Mar 17, 2019

同样也是在anaconda3中conda create虚拟环境,然后conda install了mkl的包,但是一直报错 import mkl
ImportError: No module named mkl。
解决方法如下:
At least for Anaconda python, this can be fixed by installing the package conda install mkl-service, which allows you to call import mkl

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants