Selecting custom-specified kernel in Jupyter Notebook using Pycharm

Answered

Hi there~

I am new to use Jupyter Notebook in Pycharm community 2018.2.4. And I use Anaconda to manage my virtualenvs. There are two main environments in my conda env list: base(python3.6.5) and scipython(python3.6.6).

Here is what I encountered.

I created a new project under "scipython" and it performed very well. And I just want to try to run some snippets in Jupyter Notebook. Anaconda provided easy access to Jupyter Notebook, in which my default environment is "base". Usually,I would change it in the tab of the browser interface .

When I open Powershell and run "Jupyter Notebook", then copy the token to Pycharm, something goes wrong here. I cannot switch the kernel to the right one manually since the default option is "base".

Of course I tried to edit configuration in RUN tab but it seems not to work. As you can see, the intepreter specfied here is my project intepreter: "scipython".

 

I'm just new to Python and Pycharm. Could anyone tell me what I can do?

0
5 comments

Hi Waston,

Could you please check if everything is correct according to https://www.jetbrains.com/help/pycharm/using-ipython-notebook-with-product.html?

If doesn't work, please try and re-install kernel with

python -m pip uninstall ipykernel
python -m pip install ipykernel
1

Please vote for the corresponding feature request: PY-24768.

0
Avatar
Permanently deleted user

Thank you for the kind reply.

I've followed the procesures Sergey provided to check my settings and jupyter installations. But I still couldn't figure out where the problem is.

Also, I voted for the feature request. It is happy to hear that there are some others who want the same feature in Pycharm. It is helpful for data science amateurs to combine the most powerful python IDE and the handy reproductive notebook. Hope the developers could pay attention to this.

0
Avatar
Permanently deleted user

This is what worked for me.  Change "myenv" to your python environment name below.  This seems to properly set some kind of configuration...

source activate myenv
python -m ipykernel install --user --name myenv --display-name "Python (myenv)"

Got it from:

https://stackoverflow.com/questions/39604271/conda-environments-not-showing-up-in-jupyter-notebook

 

0

Oh my God! thanks Brian! not even ChatGPT was able to help me with this haha :P 

0

Please sign in to leave a comment.