jupyter-notebook

How to replace “from IPython.kernel import KernelManager”?

此生再无相见时 提交于 2021-02-19 06:35:26
问题 I have some code which tries to import a KernalManager from IPython , but I get a Warning /home/alex/Projects/VETests/ipyrunner/local/lib/python2.7/site-packages/IPython/kernel/__init__.py:13: ShimWarning: The `IPython.kernel` package has been deprecated since IPython 4.0.You should import from ipykernel or jupyter_client instead. "You should import from ipykernel or jupyter_client instead.", ShimWarning) but when I do the following from ipykernel import KernelManager I get an error

Get current jupyter-lab notebook name [for Jupyter-lab version 2.1 and 3.0.1 and notebook version >6.0.3)

半城伤御伤魂 提交于 2021-02-19 06:14:43
问题 Problem Hi all, As my title suggested it, I would like to get access to the notebook name (in jupyter-lab ) as a variable. So I could reuse it in the notebook itself (for example to name some figure files generated in the notebook). I saw that a similar issue was opened years ago [see here]. However I didnt find a satisfactory answer. I like the simplicity of the answer suggested by @bill: import ipyparams currentNotebook = ipyparams.notebook_name However, it doesn't work for me. I got this

bash script to run jupyter notebook in virtualenv

人走茶凉 提交于 2021-02-19 04:19:20
问题 To speed up launching projects I created a small bash script which does the following: takes an argument (project name) moves to the directory of that project starts a virtual environment starts a jupyter notebook #!/bin/bash if [ "$1" == "k3" ]; then project_path="tau-code/k3-analysis/" fi codepath="/media/peter/somedrive/code" full_path="$codepath/$project_path" # Go to directory of project cd $full_path # Start environment & notebook if available pipenv shell jupyter notebook --ip=0.0.0.0

bash script to run jupyter notebook in virtualenv

一世执手 提交于 2021-02-19 04:18:25
问题 To speed up launching projects I created a small bash script which does the following: takes an argument (project name) moves to the directory of that project starts a virtual environment starts a jupyter notebook #!/bin/bash if [ "$1" == "k3" ]; then project_path="tau-code/k3-analysis/" fi codepath="/media/peter/somedrive/code" full_path="$codepath/$project_path" # Go to directory of project cd $full_path # Start environment & notebook if available pipenv shell jupyter notebook --ip=0.0.0.0

Train multiple keras/tensorflow models on different GPUs simultaneously

有些话、适合烂在心里 提交于 2021-02-19 01:42:07
问题 I would like to train multiple models on multiple GPUs at the simultaneously from within a jupyter notebook. I am working on a node with 4GPUs. I would like to assign one GPU to one model and train 4 different models at the same time. Right now, I select a GPU for one notebook by (e.g.): import os os.environ['CUDA_VISIBLE_DEVICES'] = '1' def model(...): .... model.fit(...) In four different notebooks. Though, then the results and the output of the fitting procedure is distributed in four

Jupyter widget does not appear in notebook

与世无争的帅哥 提交于 2021-02-19 01:20:51
问题 I'm running a jupyter notebook but the jupyter widgets does not appear. Instead I receive the folllowing message: Failed to display Jupyter Widget of type Button. If you're reading this message in the Jupyter Notebook or JupyterLab Notebook, it may mean that the widgets JavaScript is still loading. If this message persists, it likely means that the widgets JavaScript library is either not installed or not enabled. See the Jupyter Widgets Documentation for setup instructions. If you're reading

Jupyter widget does not appear in notebook

喜夏-厌秋 提交于 2021-02-19 01:20:33
问题 I'm running a jupyter notebook but the jupyter widgets does not appear. Instead I receive the folllowing message: Failed to display Jupyter Widget of type Button. If you're reading this message in the Jupyter Notebook or JupyterLab Notebook, it may mean that the widgets JavaScript is still loading. If this message persists, it likely means that the widgets JavaScript library is either not installed or not enabled. See the Jupyter Widgets Documentation for setup instructions. If you're reading

Why is Jupyter Notebook creating duplicate plots when making updating plots

自作多情 提交于 2021-02-18 22:43:31
问题 I'm trying to make plots in a Jupyter Notebook that update every second or so. Right now, I just have a simple code which is working: %matplotlib inline import time import pylab as plt import numpy as np from IPython import display for i in range(10): plt.close() a = np.random.randint(100,size=100) b = np.random.randint(100,size=100) fig, ax = plt.subplots(2,1) ax[0].plot(a) ax[0].set_title('A') ax[1].plot(b) ax[1].set_title('B') display.clear_output(wait=True) display.display(plt.gcf()) time

How to add syntax highlight to SQL line magic, cell magic and custom command in jupyter notebook?

北战南征 提交于 2021-02-18 20:15:11
问题 I was searching for ways to highlight SQL codes in jupyter notebook. I was able to highlight SQL cell magic only, but not line magic and custom settings. Case 1 (works) Highlight cell magic (cell startswith %%sql) Ref: adding syntax highlighting to Jupyter notebook cell magic require(['notebook/js/codecell'], function(codecell) { codecell.CodeCell.options_default.highlight_modes['magic_text/x-mssql'] = {'reg':[/^%%sql/]} ; Jupyter.notebook.events.one('kernel_ready.Kernel', function(){ Jupyter

Vim bindings for jupyter notebook/lab like Colab

半城伤御伤魂 提交于 2021-02-18 17:34:49
问题 Is there some way to have vim bindings in jupyter notebook/lab like in colab. In the included vim bindings for jupyter Lab, there isn't a NORMAL mode for editing inside the cell block. Colab however has better bindings as it allows use inside the cell block. 来源: https://stackoverflow.com/questions/59746583/vim-bindings-for-jupyter-notebook-lab-like-colab