VSCode to Jupyter: Difference between revisions

From HPCwiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 13: Line 13:


5) From the top menu, click "Token", and click "Request new API token". (You can leave the options by default)
5) From the top menu, click "Token", and click "Request new API token". (You can leave the options by default)
Then you will get your new API Token, for example:
Then you will get your new API Token, for example:
66666666666666666666
66666666666666666666
Copy this token. You won't be able to see it again, but you can always come back here to get a new one.
Copy this token. You won't be able to see it again, but you can always come back here to get a new one.



Revision as of 15:53, 20 September 2024

Our HPC (Anunna) has its Jupyter Server

If you want to connect your local VSCode (Visual Studio Code) to the Jupyter Server with certain kernel, taking Python kernel as an example, you should try:

1) Upgrade your VSCode app to the latest version. (You could firstly skip this step, however, do it if the following steps can't make a sucessful connection).

2) In the VSCode, install (or upgrade if exists) the latest version of Jupyter(Jupyter Extension for Visual Studio Code).

3) In the VSCode, install (or upgrade if exists) the latest version of Python(Python extension for Visual Studio Code). Change Python extension to R or Julia, in the case of R or Julia kernels.

4) Open Jupyter Server in the browser, login with userID and credentials.

5) From the top menu, click "Token", and click "Request new API token". (You can leave the options by default)

Then you will get your new API Token, for example: 66666666666666666666

Copy this token. You won't be able to see it again, but you can always come back here to get a new one.

6) In the VSCode, open the command palette. You can also use hotkey ('Cmd+Shift+P' on MacOS, 'Ctrl+Shift+P' elsewhere)

6.1) Then type> create: New Jupyter Notebook

Or, click menu "File" -> "New File..." and select "Jupyter Notebook".

6.2) Now you are in the ipynb editing mode. On the right up corner, click "Select Kernel" and choose "Existing JupyterHub Server..."

6.3) Enter the remote URL by: https://notebook.anunna.wur.nl/user/<userID>/?token=66666666666666666666

replace <userID> with yours, and change the 66666666666666666666 to your own API token created in step 5)