Skip to content Skip to sidebar Skip to footer

How To Install 'plotly' From Inside Anaconda Under Colab On Mac

I tried to import plotly in Anaconda with code import plotly.graph_objs as go from plotly import __version__ from plotly.offline import download_plotlyjs, init_notebook_mode, plot,

Solution 1:

Jupyter Notebooks start in an "environment". Anaconda created the environment and it contains a lot of useful libraries. It also holds a self-contained python interpreter. In this instance, the environment didn't have the library plotly installed (it's not a default library that Anaconda provides) so you had to install plotly in your environment that the notebook lives in.

The environments that are used with Jupyter Notebooks are a little tricky to get to in order to install things, so this way, using import sys then installing the library with !{sys.executable} -m pip install plotly finds the python interpreter with !{sys.executable} and installs plotly using pip right in the Notebook itself.

More reading:

try:

import sys
!{sys.executable} -m pip install plotly
import plotly.graph_objs as go
from plotly import __version__
from plotly.offline import download_plotlyjs, init_notebook_mode, plot, iplot
init_notebook_mode(connected=True)

Post a Comment for "How To Install 'plotly' From Inside Anaconda Under Colab On Mac"