ModuleNotFoundError: No module named ‘IPython’ [Fix]

Question: I got this error “No module named IPython” while executing a Python program. The complete error message is below. Any idea of how to fix the same?

$ python san.py
Traceback (most recent call last):
File "san.py", line 2, in <module>
from IPython import get_ipython
ModuleNotFoundError: No module named 'IPython'

Solution: It means, the program is trying to reference ipython library that’s not installed in the system. All you need is, install ipython using pip as shown below:

# pip install ipython
[....]
Requirement already satisfied: parso>=0.7.0 in /home/ubuntu/.conda/envs/iisc_dm/lib/python3.8/site-packages (from jedi>=0.10->ipython) (0.7.0)
Installing collected packages: ipython
Successfully installed ipython-7.14.0

Note:

Use pip version corresponding to your Python version.

Anaconda

If you are using Anaconda (full version), ipython comes pre-installed. If you are using miniconda or if ipython is removed for some reason you can re-install.

# conda install -c anaconda ipython

That’s it! Learn more about Python installation errors and solutions. If you ever want to use different versions of Python, then it’s a good idea to create different Python environments.

Updated on May 18, 2020

Was this article helpful?

Related Articles

Leave a Comment