If you use VSCode, you should use its Jupyter Notebook extension, it's quick, clean and very easy to use.
Or read more in Python Installation.
If you meet error
OSError: [Errno 99] Cannot assign requested address, tryInside notebook:
With docker
Read more here.
Suppose that we have a folder structure like this,
I want to call function
get_youtube_video_metadata() inside transcribe.py. However, in that file, I import from app.constant import ....In the jupyter notebook,
Don’t forget to add
__init__.py inside the app folder.Suppose that you are running a kernel at
In VSCode → Open a notebook → Click Select Kernel on the top right of the notebook → Existing jupyter server → … → paste the above url and hit Enter.
- Running 2 tasks in the same cell TAKE LONGER TIME than running each on different cells.
- Download a folder in jupyter notebook:
- Inside notebook, use:
- Or using nbzip (only working on current server).
Check where command executed from (in your
$path)?You CANNOT put
# comments at the end of each line break!There are 2 modes: command mode (pres
ESC to activate) and edit mode (Enter to activate). Below are the most useful ones (for me).You can edit / add more shortcuts in Help > Edit Keyboard Shortcuts.
Open jupyter notebook in local browser but the backend-server is on remote.
- If jupyter server is already running on remote at
http://192.168.0.155:9889
Open browser:
http://localhost:9888 (type password if needed).- If jupyter server is not running on remote yet,
On remote,
It's running and there are somethings like that,
Open another terminal window and type,
Open browser:
You can choose any port number you wanna instead of
9888 and 9889 (they can be the same), note that, you need to use a port number GREATER THAN 8000!Using
conda (ref)Using
pipCheck version and update/upgrade,
Put below codes in the markdown cell of Jupyter Notebook.
- You can define your custom magic functions here.
Auto update the new updated modules (put at the beginning of the notebook)
Check more settings of
%autoreload here.Show the plots inside the notebook:
Get the commands from 1 to 4:
With the bash command line + and using also
curl👉 Note: REST API with cURL.
We can run bash script inside a cell with
! pip install numpy.- Install npm and nodejs.
- Install this extension.
- Enable in jupyter lab view.
- Refresh the page.
- Install
xeus-python,jupyterlab
- Install this extension.
- Refresh the page, you have to choose kernel xpython (instead of Python 3) to use the debugger.