module not found on ipython notebook

六眼飞鱼酱① 提交于 2019-12-03 10:39:21

I was able to fix this error on Ubuntu by adding a cell to the top of the notebook appending the module directory to the path:

import sys
sys.path.append('/usr/lib/python2.7/dist-packages')

The path to add can be found when running pip install <something>, (such as numpy) and it tells you where each package is installed or already exists.

Is it possible that /usr/bin/python is actually a symlink?

The better solution is that you should be running your ipython notebook from a virtualenv that contains all the modules that you need.

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