I'm trying to connect to a remote Jupyter notebook using the VS Code Jupyter extension.
Afterwards an input field asking for the token is shown. When I enter the token and press Enter<\/kbd> , nothing happens.
Using a notebook hosted on
localhost:8888<\/code> and well an notebook hosted on a different computer within my home network
192.168.0.11:8888<\/code> .
Both ways do not work.
If I do not start VS Code within a Python environment with
jupyter<\/code> installed, I am not able to run any notebooks (but this seems to be an know issue).
(If yes, how?)
使用以下命令:
jupyter notebook --ip=0.0.0.0 --port=8080 --allow-root
At first glance, it would appear that you got the token incorrect. When I chose the option to enter the Url of a remote server and got the token wrong, the only indication things weren't working was the fact that I couldn't execute any Python code. And, when I used that same Url in a browser, I got a web UI that asked me to enter a token. Once I found and entered a valid token, I got their nice little UI for working in notebooks.
As for my experience, I just got it working in VsCode a few moments ago: I have a .ipynb file open in VsCode, it's switched to being pointed at my remote Jupyter Server, and I can execute code against it and get output.
docker run -d --name jspark -p 8888:8888 jupyter/pyspark-notebook
docker exec -it jspark jupyter server list
ip addr
If everything goes as expected, VsCode will "think" for a bit while it tests the connection, and then you'll see that "play" button show up to the left of your Python cell(s).
I used this code to prove it was working:
from pyspark.sql import SparkSession
spark = SparkSession.builder.getOrCreate()
df = spark.read.json("/usr/local/spark/examples/src/main/resources/people.json")
df.show()
And now I can move on to improving the experience, since I have a known working baseline. I'm hoping to get autocomplete/Intellisense working, but based on what I've read so far, I'm not holding my breath.
The problem I encountered is as follows
command 'jupyter.selectExistingNotebook' not found
I installed the Jupyter extension on vscode. Follow the instructions: Remote Jupyter kernel on Server / Docker
Try this to connect to a remote Jupyter kernel running on a server, or inside Docker container:
Start a remote Jupyter Notebook or headless KernelGateway
Find the token in the output of the Jupyter server logs: http://jupyter-notebook.readthedocs.io/en/latest/security.html
Then in VS Code: ctrl+shift+p
Jupyter: Enter the url of local/remote Jupyter Notebook
I only installed docker and run the container.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.