ImportError: No module named IPython

时光怂恿深爱的人放手 提交于 2020-05-14 14:52:06

问题


When i try to use from IPython.display import clear_output, display_html, then i show the error:

Error Image
(ImportError: No module named IPython)

I am using Python 2.7.13, and im trying to make the game of life from John Conway. I am following this link: http://nbviewer.jupyter.org/url/norvig.com/ipython/Life.ipynb

I have read another questions and answers about it, but any answer works for me. First, this error is showed in command line, and when i try to run this code in a file. Second, this error is direct to IPython, not submodule or something similiar.


回答1:


Ok, finally i achieved my goal.

  1. I wrote ipython --version but i found, it was not installed.
  2. I tried to install it, with pip. I went to C:\Python27\Scripts, here is pip, you can try in this directory, or add to environment variables.
  3. I tried to install ipython, but i found a error

error: Unable to find vcvarsall.bat

so i installed visual studio c++ 9.0, the version to python 2.7.

  1. pip install ipython



回答2:


For Anaconda try,

conda install -c anaconda ipython



回答3:


Use this code to install the IPython library:

!pip install ipython
import IPython

Well, this works on Google Colab.




回答4:


This is most likely because ipython is not installed.

You can install it with pip.

pip install ipython

If you are using Anaconda (the full version) ipython comes preinstalled. If you are using Miniconda or if the ipython is deleted for some reason you can re-install with

conda install -c anaconda ipython

If you are using it with jupyter. You might want to register the ipython with a user.

python -m ipykernel install [--user] [--name <machine-readable-name>] [--display-name <"User Friendly Name">]

Reference :

  1. Official Documentation


来源:https://stackoverflow.com/questions/45179915/importerror-no-module-named-ipython

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