Jupyter Notebook authentication token while in Pycharm
The shortest way I found:
If you type jupyter notebook
in a PowerShell terminal, PowerShell will automatically print out the localhost, port, and token that PyCharm
needs to run.
You can run the command from PyCharm Terminal so it will go to the same interpreter if you have several.
Running jupyter notebook list
will display all of the running servers on your machine. So doing this in the terminal after starting a cell in PyCharm will result in output similar to
Currently running servers:
http://127.0.0.1:8888/?token=f85145dda03dc598bbbfa6e53b93cbcb27629ea00cfd2105 :: /home/....
which contains the appropriate token for authenticating.
- Edit/enter the URL as:
http://localhost:8888
(remove"?token="
at the end) and click OK. - A bubble prompt will appear near the top of your PyCharm window, saying "Cannot connect to Jupyter Notebook. Run Jupyter Notebook". It should look like this (depending on your color scheme):
- Click on the link: "Run Jupyter Notebook"
- PyCharm will start the Jupyter server for you and it will create a new token. Look at View -> Tool Windows -> Run, to see details of the new token, and an optional URL to open in a web browser.
More info: https://www.jetbrains.com/help/pycharm/using-ipython-jupyter-notebook-with-pycharm.html