Search code examples
jupyter-notebookplotlyimporterror

in Jupyter Notebook ModuleNotFoundError: No module named 'plotly'


I installed plotly library using anaconda prompt and it is appearing in my conda list. I can use it in Spyder but when i Import it in my Jupyter Notebook it Shows an Import error.


ModuleNotFoundError                       Traceback (most recent call last)
<ipython-input-2-182e2a6c8e92> in <module>
----> 1 import plotly as py

ModuleNotFoundError: No module named 'plotly'

But in my conda list it is seen as this.

plotly                    3.10.0                     py_0    conda-forge

Solution

  • Your Jupyter Notebook is probably not part of the Anaconda. Hence it is not recognising packages installed through Anaconda.

    Solution 1 install Jupyter Notebook in Anaconda and try to run notebooks from there. When you will import plotly there it will be imported.

    Solution 2 install pip. Here's how: how to install pip Then use pip install plotly in command prompt. You will be able to import plotly in Jupyter now.

    Feel free to comment if you have any questions.