Could the reason why I can't select any kernels in VS Code be this error?

  • Thread starter Thread starter arhzz
  • Start date Start date
arhzz
Messages
282
Reaction score
56
I am trying to run an .ipynb file and have installed Miniconda as well as created an environment as such

-conda create -n <env_name> python=3.7 ipykernel jupyter

I am assuming this is successful as I can activate this environment via the anaconda prompt and following command

-conda activate <env_name>

Then I downloaded and installed VS code and I am trying to edit an .ipynb file. I want to select a kernel, via VS Code but when I press the button on the upper right corner I am greeted with the message that I need to install Python and Jupyter extensions. As soon as I do that the following error shows up

"Extension activation failed run the 'Developer: Toggle Developer Tools' command for more information

Source: Jupyter (Extension)"

and I am not able to select any kernel.Additionaly,when I try running any Jupyter related commands such as

"Jupyter: Create Interactive Window"

I get error messages of the following type:

Command 'Jupyter: Create Interactive Window' resulted in an error (command 'jupyter.createnewinteractive' not found)

This error is common as far as I know and has been discussed here at StackOverflow. See following link Extension activation failed, run the 'Developer: Toggle Developer Tools' command for more information

Now I have tried the solution that was suggested on this question and it did not work. I tried installing prior versions of jupyter as well as tried completely deleting the extensions from the extensions folder. My last resort was reinstalling VS code altogether but that either did not resolve the issue.

So my question is could this be the cause of me not being able to select the kernel? If so how do I resolve this issue.

Many thanks!
 
Technology news on Phys.org
Try doing it without the environment switch. Most devs install VS Code separately so its available in any environment.
 
What do you mean without the environment switch? Could you elaborate more.
On a side note I am now certain it is a VS code issue since I tried doing it the oldschool way and just opened a juptyer notebook and it worked just fine.
 
I misread what you were doing.

The suggestions I saw were:

1) Make sure that after switching to your new environment, you can run the Python command

$$ which python
$$ python --version

On my macOS, there is no Python; instead you call it up via python3.

2) Add Jupyter kernel for notebooks:

$$ python -m pip install ipykernel
$$ python -m ipykernel install --user --name xyz --display-name "Python (xyz)"

3) After switching to your new environment, when starting up VS Code, do it via the 'code' command to be sure it's got the same environment.

$$ code .

4) You may need to initialize conda in your .zshrc (or .bashrc...):

$$ conda init zsh // (or whatever shell you're using: bash, sh, csh, ksh...
 
Last edited:
jedishrfu said:
I misread what you were doing.

The suggestions I saw were:

1) Make sure that after switching to your new environment, you can run the Python command

$$ which python
$$ python --version

On my macOS, there is no Python; instead you call it up via python3.

2) Add Jupyter kernel for notebooks:

$$ python -m pip install ipykernel
$$ python -m ipykernel install --user --name xyz --display-name "Python (xyz)"

3) After switching to your new environment, when starting up VS Code, do it via the 'code' command to be sure it's got the same environment.

$$ code .

4) You may need to initialize conda in your .zshrc (or .bashrc...):

$$ conda init zsh // (or whatever shell you're using: bash, sh, csh, ksh...
Ah I see, already did that. Unfortunatly did not help. Guess I am going to stick with the oldschool way
 
Thread 'Is this public key encryption?'
I've tried to intuit public key encryption but never quite managed. But this seems to wrap it up in a bow. This seems to be a very elegant way of transmitting a message publicly that only the sender and receiver can decipher. Is this how PKE works? No, it cant be. In the above case, the requester knows the target's "secret" key - because they have his ID, and therefore knows his birthdate.
Back
Top