No Kernel Specs found in Atom Hydrogen - python

I tried to install Hydrogen into ATOM, but get No Kernel Specs found error.
I installed jupyter notebook via anaconda and previous ran a "conda install jupyter" in anacoda prompt.

Is it a python file you’re trying to run?
In terminal what does jupiter kernelspec list —json give you?
If you open a Jupiter notebook can you open a python notebook and run that in a kernel? In terminal jupyter notebook, then select python from new on top left of home page of jupyter.
Is the grammar for that file python or do you have magic python or something else installed? If there is a different grammar you will need to map in hydrogen settings, eg for magic python: {“python”: “magicpython”}

Related

VScode jupyer not loading ipython instance installed in a conda environment

I have noticed this both on Linux and MacOS. I have a conda environment for data science stuff, which I have installed ipython, ipykernel, jupyer, and a bunch of other data science dependencies. In VSCode, when I try to select a python interpreter, it shows just fine.
I have been able to run regular python files without issue. However, in Jupyter notebooks, when I try to select a kernel, it is only showing the system installed python interpreter (/usr/bin/python and such). Oddly, sometimes if I click the 'Select kernel' button early enough, it will temporarily show the conda environment as an option, but then in a second it will disappear. If I click the option fast enough, it also just resets to the system python and when I try again to select the kernel, it only shows the system options.
This problem occurs in python 3.11.
Open the extension store and change the jupyter extension to pre-release version.
Use command python -m pip install jupyter in the terminal.
Use shortcuts "Ctrl+Shift+P" and search the following option:

Jupyter notebook setup in VS Code was working fine; now get "Running cells with 'Python 3.9.12 64-bit' requires ipykernel package."

I have a python project (folder) that I'm working on in VS Code (in Windows) and it uses Jupyter notebook. The project uses a virtual env. It was working fine a few days ago. Today when I open up one of the .ipynb files in the project, I see:
Running cells with 'Python 3.9.12 64-bit' requires ipykernel package.
Run the following command to install 'ipykernel' into the Python
environment. Command:
'c:/Users/myName/AppData/Local/Programs/Python/Python39/python.exe -m
pip install ipykernel -U --user --force-reinstall'
I don't understand why VS Code is looking at the system installation of python. I have the following in settings.json in the .vscode subfolder of this project:
{
"python.pythonPath": "proj_env\\Scripts\\python.exe",
"python.terminal.activateEnvironment": true
}
And in the virtual environment for this project, I have confirmed I have ipykernel installed. It was working fine a few days ago. I see that ipykernel was updated 10/31/2022, so just to try it, I updated the ipykernel package in the virtual env from 6.15.2 to 6.17.0.
But clearly for some reason VS Code is looking to the system installation of python instead of the virtual env.
Pulling my hair out because I changed nothing in the past few days. In fact I just opened the project today for the first time since a few days ago when it was working fine.
When I press CTRL+SHIFT+P to select python interpreter, the virtual env python interpreter is already selected. But I still see the warning posted above re: ipykernel package needing to be installed.
Where am I going wrong?
Here's my attempt at an explanation of the solution. I'm sure someone understands this better and can explain it better (please do and I will pick your answer as the solution!):
VS Code uses one python interpreter for .py files and terminal and a different python interpreter for Jupyter notebook (.ipynb) files. The kernel I wanted wasn't there, and it was using the system installation of python, which is why I was getting this message (ipykernel not installed to system environment, and I don't want it there), while the virtual env python (which has ipykernel) was being used for .py and terminal in the same project, hence the confusion.
To 'install' the kernel for Jupyter, I activated the virtual env in VS Code powershell terminal. Then ran:
python -m ipykernel install --user --name=project_name
Then exit VS Code, restart, open project folder and in upper right corner of Jupyter notebook, use the kernel picker to select the kernel. The kernel I just created wasn't there, so I used CTRL+SHIFT+P in VS Code, then type Jupyter: Filter Kernels, and there I could see the kernel I created, and it was checked, then went back to kernel picker and was able to select the correct kernel.
So now the .ipynb code has access to all the packages installed in this virtual environment.
One annoyance is VS Code doesn't 'remember' that this is the kernel I want for this project, so I have to select the kernel each time I open this project. I'm sure there's a solution for this, but I'll have to look for that later.

Jupyter notebook python version different from environment python version

I wanted to run jupyter notebook with python: 3.7.10 so I created a virtual env and activated it using anaconda. Then when I run Jupyter notebook, it still uses python 3.8.8. How can I change the python version used by jupyter notebook?
Thank you for your help in advance.
You have probably typed jupyter notebook in the command prompt and it opened.
Actually jupyter and notebook are two modules that you need to install on your virtual environment. So that you can leverage jupyter notebook from that environment.
In your case since you didn't had them it started from the one having.
Now the way I suggest to start jupyter from a particular environment is from the navigator itself as shown in the figure below.
Select your environment and then install and launch jupyter notebook.
If it doesn't work you can try integrating conda with jupyter notebook and run your environment directly from jupyter notebook using the package nb_conda. Check this 4 min video youtu.be/Ro9l0eapoJU for the process.

Just installed Jupyter using Anaconda but can't run it using terminal. Says command not found

I just bought my very first Mac after using Windows my entire life and have been trying to install things. I am also still kind of a beginner at programming.
I installed Anaconda for Python 2.7 version, and then I installed the 3.7 version right after.
I tried going to terminal and typing jupyter notebook but it says:
zsh: command not found: jupyter
I am able to launch a jupyter notebook (I think) when I search for jupyter notebook in spotlight and executing the top hit.
I've been reading a lot on forums about this issue and see a lot of people talking about PATH which I am not really sure about.
I've seen people also post their which python information and theirs seem very different from mine:
which python3
usr/bin/python3
which python
usr/bin/python
Any help would be appreciated! Still learning how to set up this Mac. Thank you.
You might want to refer to this link https://jupyter-notebook-beginner-guide.readthedocs.io/en/latest/execute.html
3.1.2. Change Jupyter Notebook startup folder (Mac OS)
To launch Jupyter Notebook App:
Click on spotlight, type terminal to open a terminal window.
Enter the startup folder by typing cd /some_folder_name.
Type jupyter notebook to launch the Jupyter Notebook App The notebook interface will appear in a new browser window or tab.
From what I can understand you are not changing to the startup directory of Jupyter.
You need to add jupyter to your path.
In your terminal, type in the following command:
export PATH="/PUT JUPYTER PATH HERE:$PATH"
Then try jupyter notebook
Reasoning: If installing using pip install --user, you must add the user-level bin directory to your PATH environment variable in order to launch jupyter lab

Can't launch Jupyter Notebook at all

I recently installed the Anaconda Navigator (Anaconda 2) on a Windows 8.1 machine.
If I launch Jupyter Notebook from the Anaconda window, I am met with a 'Page cannot be displayed' error in my browser (Chrome).
I have tried launching Jupyter Notebook from the Anaconda Prompt (no notable error message output). I have also tried opening the Notebook in a different browser (Firefox), and I have tried running the Prompt in Administrator mode. No luck.
I have Jupyter Notebook version 5.6.0 according to the Navigator, but if I type jupyter --version at the prompt it says 4.4.0 (wondering if this is a problem?)
I kind of expected to be able to launch a Notebook right off the bat after installing Anaconda. Is there some set-up I have missed?
(Edit) Tried a few more things, after reading the Jupyter Notebook docs. Tried replacing 'localhost' in the URL with 127.0.0.1, and tried opening the link Chrome with --disable-web-security. Didn't help.
Steps which i will advice:
1) Open your command prompt in the directory which contains your notebook or where you want to create new notebook.
2) Write jupyter notebook in cmd and press enter.
If jupyter notebook is properly installed then it will certainly open, else try reinstalling it.
Note: You can always update your jupyter notebook via conda or pip. At time if you update or install package/IDE via pip, Anaconda terms it as "broken link" and give issue.

Categories