Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I get IntelliJ/PyCharm to recognize an active IPython kernel?

I have used Jupyter notebooks for some time now without any problems. However I use IntelliJ for pretty much all my programming and wanted to try out moving my ipython workflow into IntelliJ. I followed the instructions provided here and everything seems to work fine except when I go to run a cell it keeps trying to start the kernel even though the kernel should already be running.

IntelliJ screenshot

I can use the kernel in Jupyter like normal when I follow the link, but I can not use it from IntelliJ.

like image 309
zjuhasz Avatar asked Dec 18 '16 10:12

zjuhasz


People also ask

How do I run IPython in PyCharm?

IPython is available on your computer with Anaconda. The corresponding Conda environment is set as the default interpreter for the current project. Once you set a Conda environment as a Python interpreter, PyCharm automatically recognizes IPython, and changes the prompt of the Python console. From the main menu, select Tools | Python Console.

How do I use Conda with PyCharm?

Once you set a Conda environment as a Python interpreter, PyCharm automatically recognizes IPython, and changes the prompt of the Python console. Use the magic commands of IPython From the main menu, select Tools | Python Console. If IPython has been properly installed, PyCharm will report about the version used.

Which Python interpreter does PyCharm support?

In PyCharm you are not limited to using just any single Python interpreter. You are able to implement several and in doing so choose which interpreter you wish to use for any specific project. PyCharm supports: Standard Python interpreters (see the Supported versions)

What is the IPython kernel?

The IPython kernel is the Python execution backend for Jupyter. The Jupyter Notebook and other frontends automatically ensure that the IPython kernel is available. However, if you want to use a kernel with a different version of Python, or in a virtualenv or conda environment, you’ll need to install that manually. Kernels for Python 2 and 3 ¶


2 Answers

To make it work you should select a right interpreter in Project Settings. Seems like jupyter is installed on your system interpreter. Meanwhile it is recommended to use venv with pycharm(and python in general). If you created venv than you need to select python interpreter from that venv and it should do the job.

like image 130
Nikolay Osaulenko Avatar answered Oct 20 '22 05:10

Nikolay Osaulenko


I got in touch with Jetbrains support and they told me this was a known issue with their Jupyter integration. However the latest version of the python plugin for IntelliJ seems to have fixed the issue.

https://youtrack.jetbrains.com/issue/PY-22032

like image 1
zjuhasz Avatar answered Oct 20 '22 06:10

zjuhasz