Cannot open Octave within Jupyter - python

I've installed Octave on my Windows 10 PC, and used pip to add the octave kernel for Jupyter, but when I run jupyter notebook from the command line and go to Jupyter, I Octave doesn't appear under the New dropdown. This answer suggested adding the environment variable OCTAVE_EXECUTABLE to C:\\Octave\\Octave-4.2.1\\bin\\octave-cli.exe. The path to Jupyter is different on my machine - it seems to be D:\Program Files\GNU Octave\Octave-6.1.0\mingw64\bin\octave-cli.exe so that's what I've set my environment variable to that, and also put D:\Program Files\GNU Octave\Octave-6.1.0\mingw64\bin on my path. Even after that, and rebooting, Octave still doesn't appear in Jupyter.
What do I try next?

I suppose you didn't install octave kernel I was into a similar situation initially though mine is not windows use
pip3 install octave_kernel // I suppose you are using pip
If this didn't solve your answer please let me know the error when you run this
jupyter console --kernel octave

Related

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.

Can't launch Jupyter Notebook from the command line in Windows 7

On a Windows 7 machine, I installed Python 3.8.5, pip using the get-pip.py installation script from here, and Jupypter Lab + Jupyter Notebook following the instructions here. When trying to launch Jupyter Notebook, I get the following error message:
C:\jupyter notebook
'jupyter' is not recognized as an internal or external command,
operable program or batch file.
What is the problem? I verified that both Python and pip was successfully installed by launching the Python console and doing pip -V.
https://jupyter.org/install is general installation instructions, but assume some familiarity with Python, pip, and system execution path searching.
You need to add the location where pip installed jupyter to you system PATH environment variable.
To test this theory, try seeing if you have jupyter.exe in a folder similar to C:\Program Files\Python38\Scripts.
Answers to questions like this one, explain ways to edit the PATH variable.
Screenshot example of editing user's PATH:
I don't know the exact condition but try this..
"jupyter notebook"
and if it doesn't work then you might want to add installation location to your environment variables.

pip3 install of Jupyter and Notebook problem when running

I have tried all of the things here on stack and on other sites with no joy...
I'd appreciate any suggestions please.
I have installed Jupyter and Notebook using pip3 - please note that I have updated pip3 before doing so.
However when trying to check the version of both jupyter --version and notebook --version my terminal is returning no command found. I have also tried to run jupyter, notebook and jupyter notebook and I am still getting the same message.
I have spent nearly two days now trying to sort this out... I'm on the verge of giving up.
I have a feeling it has something to do with my PATH variable maybe not pointing to where the jupyter executable is stored but I don't know how to find out where notebook and jupyter are stored on my system.
many thanks in advance
Bobby
You should be able to run jupyter with python -m even if the PATH variable is not set up correctly.
python -m jupyter notebook
you can check the PATH variables on Windows if you search in with the windows search function for env and then click on Edit the system environment variables > Environment Variables....
The path variable is a list of paths that the terminal checks for commands.
I didn`t work on Mac for a long time, so not sure how similar linux and mac command line still are, but on debian you control your path variable like this.
View paths:
echo $PATH
/usr/local/bin:/usr/bin:/bin
Add a path:
export PATH=$PATH:/mynewpath
For constant export add to ~/.bashrc
To view the path of the pip package, you can use
pip3 show jupyter
When jupyter-notebook works and jupyter notebook does not. It looks to me like a symlink thing. Or a Mac-specific problem.
So to summarise this is what I have found on this issue (in my experience):
to run the jupyter app you can use the jupyter-notebook command and this works, but why? This is because, the jupyter-notebook is stored in usr/local/bin which is normally always stored in the PATH variable.
I then discovered that the jupyter notebook or jupyter --version command will now work if I did the following:
open my ./bash_profile file
add the following to the bottom of the file: export PATH=$PATH:/Users/your-home-directory/Library/Python/3.7/bin
this should add the location of where jupyter is located to your path variable.
Alternatively, as suggested by #HackLab we can also do the following:
python3 -m jupyter notebook
Hopefully, this will give anyone else having the same issues I had an easier time resolving this issue.
I've found a solution from the documentation over at Jupyter https://jupyter-notebook.readthedocs.io/en/stable/troubleshooting.html but I am still curious.
It states that to run the application to use the command jupyter-notebook and hey-presto! It does seem to work now. But, why is this when nearly everywhere else I have read that to run the app we just type the command jupyter notebook.
Also, if I do need to check the version of any of the Jupyter files how do I go about this now, if jupyter --version and notebook --version still don't work.
Also, how do I go about finding these files in my file system if I have no idea where they are located? And how do I go about adding these to my path so that I can, for example, check the version of these programs?
Will pip3 automatically update this software as and when needed?
Thanks again in advance
have you tried locate Jupiter? It may tell you where jupyter is on your system.
Also, why not try installing jupyter via anaconda to avoid the hassle?
I definitely would recommend going through anaconda which makes everything a lot easier.
The following is the link with step by step instructions: https://jupyter.readthedocs.io/en/latest/install.html

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

'jt' is not recognized as an internal or external command

Trying to change theme of Jupyter notebook but running into difficulty after successful install.
I run:
jt-t chesterish
'jt' is not recognized as an internal or external command, operable
program or batch file.
I know its related to not setting the environmental path somehow. But I have tried using SETX PATH but still didn't work and found not other solution thus far. I have before set up python so I can directly type "python" to get it on the command line but doesn't work for anything else like "jupyter".
Even if ı have installed the jupyterthemes and upgrade it, ı have the same issue when ı write down the command (!jt -t [themename]) into one of the jupyter notebook's cells. The solution that ı have found is open up the Anaconda prompt and after installing the jupyterthemes, write the command (jt -t exampletheme) and restart the jupyter notebook.
I had the same problem. I was using a conda environment with Python 3.7 installed. After I switched the kernel to the original standard "Python 3" kernel with Python 3.9 install, then the jt commands worked for me. Not sure if it was an environment issue or a python version issue.

Categories