iPython: cannot import module named sklearn

扶醉桌前 提交于 2021-02-08 13:37:09

问题


I am able to import sklearn using the python interpreter, but when I try to do the same in an iPython notebook, iPython throws an ImportError. Any idea what is causing this issue? I need to use a module in iPython.

enter image description here

enter image description here

I'm not sure if this will be helpful, but here is a subset of the packages that I have installed on my machine.

enter image description here

I followed the instructions here regarding the installation process: http://shanshanchen.com/2013/05/29/install-numpy-scipy-scikit-learn-on-mac-os-x-for-data-miners/


回答1:


The problem could be solved by the below commands in the notebook.

!pip install scipy
!pip install sklearn


来源:https://stackoverflow.com/questions/22753731/ipython-cannot-import-module-named-sklearn

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!