So I received an update for PyCharm yesterday which has botched my Jupyter Notebook integration. Every time I try to run a jupyter notebook cell, I get hit with this prompt: http://localhost:8888/?token=
I run jupyter notebook list
in the terminal to get list of running jupyter servers and its accompanying authenticating token. Even after entering this info into the earlier prompt, the cell refuses to run and returns with the token prompt again.
According to Using IPython/Jupyter Notebook with PyCharm, the url can be set in the Settings/Preferences dialog
of PyCharm. However, as of this new update, the option to set notebook server url is missing.
By default, PyCharm asks me to follow a link when I try to run a jupyter cell for the first time. After following the link, PyCharm is supposed to get the token and run cells in the program instead of the browser. I realized that PyCharm starts with http://127.0.0.1:8888/?token=........token
in the console, however, the prompt comes back with http://localhost:8888/?token=
.
How do I solve this token issue?
I had the same issue too, but I have resolved it.
I used Notebook 4.2.3 which is installed by Anaconda3-4.2.0 by default.
From 4.3.0, notebook generates a token when running a notebook server for security reason.
See https://jupyter-notebook.readthedocs.io/en/latest/security.html#server-security.
PyCharm 2017.2 requires a token for notebook server URL, but notebook 4.2.3 unsupports a token. So, I upgraded notebook to 4.3.
After that, PyCharm shows the notebook kernel in the Run tool window when running a notebook server as below:
See https://www.jetbrains.com/help/pycharm/running-ipython-jupyter-notebook-cells.html.
It worked.