How to install ExecuteTime extension of Jupyter notebook? - python

I installed Jupiter Notebook extensions according to https://jupyter-contrib-nbextensions.readthedocs.io/en/latest/install.html but the ExecuteTime one isn't working. It shows the message 'This nbextension is disabled in the notebook json config, but doesn't provide a yaml file to tell us how to configure it. You can still enable or disable it from here, though'. However, the folder execute_time in nbextensions contains file ExecuteTime.yaml. I am on MacOS.
Uninstall/reinstall doesn't help. I have looked for the answer across a lot of threads but there is no solution to this.
Does someone have a clue to that problem?

You should enable the execution time. For this:
pip install jupyterlab_execute_time
Then, reload the jupyterlab page.
Finally, go to the notebook section in jupyterlab advanced settings and paste:
{"recordTiming" : true,}
If it didn’t work visit: https://github.com/deshaw/jupyterlab-execute-time/tree/master/jupyterlab_execute_time

Related

Open Jupyter in VSCode: TypeError: Cannot read properties of undefined (reading 'makeSettings')

System: MacOSX 10.15,
VSCode Version: 1.67.2,
Python Kernel Version: 3.8.13 (Conda base).
I created a new Jupyter notebook in my VSCode using command shortcut and selected the right python kernel showed above. The empty notebook page is well loaded and no error message occurred.
But when I typed and ran any code in the cell, this error message showed up below the cell.
Then I clicked the "log" link and the error log showed up and it was like this:
And hence I couldn't run any code in the notebook cell. Then I changed to another Python Kernel (3.9.12) of the same notebook, it showed the same error message:
Please give me a solution to overcome this bug.
Update: I tried to reinstall pyzmq to an older version in the canda base environment and it didn't change anything. Then I typed command jupyter --version and everything is well installed.
Update: I have searched on Github Issues of VSCode. There are two similar issues that are all caused by some extensions, one is called "Gitduck"(now renamed "duckly"), the other is "nur.Script". The link to these issues are here:
Cannot read property 'makeSettings' of undefined #834
Cannot read property 'makeSettings' of undefined #128458
But unfortunately, I never have installed any of these extensions in my VSCode. So it may be caused by a similar extension but I still don't know the name.
Finally, I use the command code --list-extensions to list all my installed extensions here, maybe helpful for filtering which extension is the bad guy:
Final Update: Today (05/31) I opened VSCode and tentatively created an empty Jupyter notebook, and this problem has gone away. I have done nothing, maybe VSCode's auto-update has solved this problem. Case closed.
You can try reinstalling the pyzmq module.
pip uninstall pyzmq
pip install pyzmq==19.0.2
Hope this helps you.

Anaconda Import error, circular import error

I'm trying to use anaconda to setup an environment for jupyter notebook. It's not going well... I've got everything working without anaconda (just on the normal windows terminal). On Anaconda terminal however, whenever I try to install jupyter notebook it gives me an import error (could be circular issue it says). I also cannot open anaconda navigator through either the app or command prompt. I have followed documentation and this video. Please any help would be greatly appreciated, I am going to try uninstalling anaconda and then seeing if that gets me any results...
What is the library's name are you trying to import? I am guessing 'jupyter'
Checking your local filenames might be useful. If any files in your project involve the word that is in the import statement, that could prevent the actual jupyter library being imported.
I had the same problem, tried to import numpy and got a similar error. Turns out that I had a file called 'numpy.py' in my project directory. I renamed it and solved the problem.
Try to reset pyzmq by doing the following:
pip uninstall pyzmq
pip install pyzmq

Jupyter notebook load updated package

When I update a basic pack on cmd:
pip install --upgrade a=1.0.7
But when I run the code:
import a
print(a.__version__)
outputs:
1.0.8
It doesn't have any change even if I refresh this notebook unless I reboot. But it will give up all my data in flush. Do you have any method help?
Does reloading the module help?
See https://www.geeksforgeeks.org/reloading-modules-python/ for info how to do it depending on your python version. Up to date documentation https://docs.python.org/3/library/importlib.html#importlib.reload on the python site.

Jupyterlab and Plotly offline: requirejs is not defined

I installed plot.ly using conda and tried to use it in offline mode on Jupyterlab:
from plotly.offline import init_notebook_mode
init_notebook_mode(connected=True)
The Firefox developer console displays the following error after those statements:
ReferenceError: requirejs is not defined
I tried to manually put require.js into the folder with the notebook and into ...\anaconda3\pkgs\jupyter\nbextensions, it didn't work.
How do I solve this issue? How do I install require.js properly?
Versions:
Python 3.6.6
Plotly 3.4.2
Jupyterlab 0.35.4
Windows 10
Firefox 64.0.2
nodejs 10.15.0
Please see Yan Ulms answer: the plotly extension for Jupyter Lab is deprecated
Old answer:
You need to install the plotly extension for Jupyter Lab, as mentioned by #byouness.
A common pitfall in the installation is that you need to have a recent Node.js installation. This might be the cause of your error write EPROTO 1172:error:1408F10B:SSL routines:ssl3_get_record:wrong version number:openssl\ssl\record\ssl3_record.c:252. Re-installing Node.js might be an easy fix.
Your company firewall might indeed be a problem. Because the installation of the extension uses NPM (node.je package manager), you should check Common proxy and networking problems for NPM. You might need to install the extension manually, by following the installation instructions for developers.
I definitely agree that the process is much more difficult than it should be. Installing it at my company was also a struggle. Good luck!
The JupyterLab readme on GitHub says that the #jupyterlab/plotly-extension is being deprecated. Please use the Plotly-supported jupyterlab-plotly. See the plotly.py README for more info.

Local copy of MathJax on a Jupyter notebook

I´m using the new Jupyter notebook (neé ipython notebook) and the docs indicate that it renders MathJax from a CDN. I have some situations when outside connections are blocked, so I need to configure a local copy of MathJax for all notebooks. How can I accomplish that?
As of 4.0 mathjax is part of the notebook as a dependency. There is no need for any extra installation.
I am currently experimenting with jupyter on a RaspberryPi. After installation of python 3.4 and jupyter I found MathJax in:
/usr/local/lib/python3.4/site-packages/notebook/static/components/MathJax
from my jupyter_notebook_config.py file:
# c.NotebookApp.mathjax_url = ''
c.NotebookApp.enable_mathjax = True
Credits go to #minrk who clarified this to me!
On Arch Linux, installing 'community/mathjax' solves the problem.
Open any notebook and write:
From IPython.external import mathjax
Then you can read how to install by writing: 'mathjax?' but basically you execute a function 'install_mathjax()'. Haven't tried it though.

Categories