Using %matplotlib notebook after %matplotlib inline in Jupyter Notebook doesn’t work

You just have the wrong order of your commands. A backend should be set before importing pyplot in jupyter. Or in other words, after changing the backend, pyplot needs to be imported again. Therefore call %matplotlib … prior to importing pyplot. In first cell: %matplotlib inline import matplotlib.pyplot as plt plt.plot([1,1.6,3]) In second cell: %matplotlib … Read more

Jupyter Notebooks not displaying progress bars

The answer is in this GitHub issue. The key is to ensure that you have the ipywidgets notebook extension enabled using the following command: jupyter nbextension enable –py widgetsnbextension For the old JupyterLab 2.0 you’ll also need to install the JupyterLab extension: jupyter labextension install @jupyter-widgets/jupyterlab-manager For the old JupyterLab 2.0 installing the JupyterLab extension … Read more

Cannot open new Jupyter Notebook [Permission Denied]

change the ownership of the ~/.local/share/jupyter directory from root to user. sudo chown -R user:user ~/.local/share/jupyter see here: https://github.com/ipython/ipython/issues/8997 The first user before the colon is your username, the second user after the colon is your group. If you get chown: [user]: illegal group name, find your group with groups, or specify no group with … Read more

How can I play a local video in my IPython notebook?

(updated 2019, removed unnecessarily costly method) Just do: from IPython.display import Video Video.from_file(“test.mp4”) If you get an error No video with supported format or MIME type found, just pass embed=True to the function: Video(“test.mp4”, embed=True). Or if you want to use the HTML element: from IPython.display import HTML HTML(“”” <video alt=”test” controls> <source src=”test.mp4″ type=”video/mp4″> … Read more

How to disable password request for a Jupyter notebook session?

The following is very unsafe, but you can remove the password completely with: jupyter notebook –ip=’*’ –NotebookApp.token=” –NotebookApp.password=” Without –NotebookApp.password=”, when connecting from a remote computer to a local Jupyter launched simply with: jupyter notebook –ip=’*’ it still asks for a password for security reasons, since users with access can run arbitrary Python code on … Read more

How to clear Jupyter Notebook’s output in all cells from the Linux terminal?

nbconvert 6.0 should fix –clear-output The option had been broken for a long time previously, bug report with merged patch: https://github.com/jupyter/nbconvert/issues/822 Usage should be for in-place operation: jupyter nbconvert –clear-output –inplace my_notebook.ipynb Or to save to another file called my_notebook_no_out.ipynb: jupyter nbconvert –clear-output \ –to notebook –output=my_notebook_no_out my_notebook.ipynb This was brought to my attention by … Read more