Can't open jupyter notebook from terminal (Python 3.6) - python

I really need your help, did extensive searching online but couldn't figure out, why I can't open the jupyter notebook from my terminal. If I type in
jupyter notebook
in the terminal, it says "Error executing Jupyter command 'notebook': [Errno 2] No such file or directory". So I checked if it's even installed with the command
jupyter --version
and the result was "4.3.0". Then I tried to change the directory to the path to the config-dir aswell as the data-dir, neither one did work. So I tried to uninstall with
pip uninstall jupyter
and I got the output "Cannot uninstall requirement jupyter, not installed". I tried to re-install it aswell with
pip install --upgrade --force-reinstall --no-cache-dir jupyter
but didn't work too.
Can anyone help? How can I delete everything related to python from my mac so I can install it from zero again?
Thanks for help! --batman

Related

Trouble in jupyter notebook running by line (f10) with VS Code

Problem:
When I try running code by line (f10) with VS Code, "ipykernel setup required for this feature" message pops up.
What I've tried:
Using Anaconda Prompt: "conda install ipykernel", "conda install -c conda-forge ipykernel"
-When I tried this, the prompt said "conda-forge:: ipykernel-6.4.1-py38h595 --> pkgs/main:: ipykernel-6.2.0-py38haa95532_1"
Doesn't it mean I already install ipykernel v.6.20 or higher?
After I tried this I checked Jupyter --Version it said ipykernel 5.3.2
Other specs are qualified. (VS Code, Jupyter, Anaconda versions etc,)
Using Terminal (in VS Code): "pip install ipykernel"
Reinstalling all of add-ins such as Python for VS, Python, Anaconda, Jupyterlab, VS Code
Updating ExecutionPolicy: CurrentUser-RemoteSigned, LocalMachins-AllSigned, others Undefined.
+) Created virtual-env named envi which is conda env. In VS Code I selected this interpreter and also reloaded all windows.
As I understand, Conda install Ipkkernel > Reload is what pop-up msg required.
This is what I'm going through now.. I just got interested in Python and now I cannot doing anything..
I had the same problem. It seems there was a problem with the version of ipython or ipykernel since I managed to fix it by running the following commands in conda environment:
pip install --upgrade ipython
pip install --upgrade ipykernel
Don't know which of the two was the problem but I was able to use the jupyter notebook line-by-line feature after this.

jupyter lab not opening on jupyter-lab in CMD like in docs

In the official jupyter labs installation guide, it says to install jupyter labs with pip install jupyterlab and then launch with jupyter-lab.
However, what I did was try the first installation method, and when the jupyter-lab command to open didn't work, I tried installing again with python -m pip install jupyterlab.
Now the jupyter-lab command that is listed still isn't recognized, but after playing around, I found that python -m jupyterlab opens jupyter labs for me.
Why is this?
Should I be concerned that I messed anything up, should I just keep using the command that I found, or try to fix my installation so that the official jupyer-lab opens the program up?
Thanks

Jupyter command `jupyter-lab` not found

I have tried to install jupyter lab on my Kubuntu machine.
If I install jupyter lab with 'pip3 install jupyter jupyterlab' the command 'jupyter notebook' works completly fine. But if I try to run 'jupyter lab' every time I get the message:
Traceback (most recent call last):
File "/usr/local/bin/jupyter", line 11, in <module>
sys.exit(main())
File "/usr/local/lib/python3.6/dist-packages/jupyter_core/command.py", line 230, in main
command = _jupyter_abspath(subcommand)
File "/usr/local/lib/python3.6/dist-packages/jupyter_core/command.py", line 133, in _jupyter_abspath
'Jupyter command `{}` not found.'.format(jupyter_subcommand)
Exception: Jupyter command `jupyter-lab` not found.
What is wrong?
I tried to reinstall jupyter and jupyterlab multiple times with the same issue.
Its the space. Its always the space. Never ever use spaces within package name. Its always either namepart1-namepart2 or namepart1namepart2. This is because arguments are separated by space. So if you put space in between, it makes pip think that you want to install two different packages named jupyter and lab. Just use:
python -m pip install jupyterlab
Or simply:
pip install jupyterlab
No need to uninstall or reinstall anything. However to run jupyter lab server you might want to add spaces as follows:
jupyter lab
In my case, the only way to fix this was to add the following directory to the PATH in Linux:
/home/ubuntu/.local/bin
When installing jupyterlab, we may get warning like this:
Installing collected packages: jupyterlab
WARNING: The scripts jlpm, jupyter-lab, jupyter-labextension and jupyter-labhub are installed in '/home/tln/.local/bin' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed jupyterlab-3.0.14
So as per this warning, scripts like jupyter-lab will be unavailable unless added to the PATH.
Use below command to add these scripts to be able to use from command line:
tln#tln-X550LD:~$ export PATH="$HOME/.local/bin:$PATH"
That's it. This worked fine for me.
I had the same error on Windows 10. It was with pip install jupyterlab. Then after the error I uninstalled it with pip and reinstalled with "pip install jupyterlab". Everything worked flawlessly thereafter.
In your case you're using pip3. Try it as above or see if pip3 needs an update.
I had same issue. I solved it running pip install jupyterlab in prompt with admin privilegies.
Had the same issue and resolved it by installing with pip3
pip3 install jupyterlab;
jupyter lab
If you face -bash: jupyter-lab: command not found or -bash: jupyter: command not found, etc., you can look for "jupyter-lab" and enter that full path instead.
Mac:
$ /Users/mark/venv/bin/jupyter-lab
Windows:
C:\mark\venv\Scripts\jupyter-lab.exe
I got this same error every time I forgot to activate the virtualenv jupyterlab was installed into. After activating the virtualenv, all's well.
With pip
$ source [path_to_venv]/bin/activate
With pipenv
$ pipenv shell
Then, with a prompt indicating an activated shell, you can enter your command
(venv) $ jupyter lab
With conda or other more holistic python environments, you probably use their gui to activate a virtualenv with jupyter and jupyterlab installed.
Install with Anaconda
conda install -c conda-forge notebook
conda install -c conda-forge jupyter
conda install -c conda-forge jupyter_contrib_nbextensions
Once installed you just have to run
pip install jupyterlab
~/.local/bin/jupyter-lab
and ready and open browser http://localhost:8888/lab
Ubuntu 22
Lubuntu 22
well the problem is like this:
the jupyterlab module has not been packaged for debian, but the jupyterlab_server package has, named python3-jupyterlab-server.
please sudo apt install python3-jupyterlab-server.
then, as your user, run pip3 install jupyterlab, that will install it in your ~/.local/bin a few programs, the missing jupyter-lab among them.
last, but not least, run jupyter-serverextension enable --py jupyterlab.
to be able to run jupyter lab, you first need to run export PATH="/home/$(whoami)/.local/bin:"$PATH. this command will run automatically if added to your ~/.bash_profile.
ubuntu can not find the jupyter-lab because it is not in path.
in order to check the place of installment. run below command
find ~ -name jupyter-lab
possible result: /home/soshiant/.local/bin/jupyter-lab
for adding a directory to the Linux path you can follow below link:
How to add a directory to the PATH
if anyone still struggling ...
try:
find ~ -name jupyter-lab
and then:
export PATH=[path]
then try again: jupyter lab
note:
don't add any extra spaces and PATH is case sensitive and if u still struggling just try to install any missing pkgs after hosting to the main path by opining another tab or changing the path to main.
and then host to localhost:8888/lab
that should works fine...
I was using conda to install
conda install -c conda-forge jupyterlab
and this error came about.
I simply used this command to get it to run.
pip install jupyterlab
In my ubuntu installation this was qused by not using sudo before the install.
sudo pip install jupyterlab
If you already installed jupyterlab, and it dit not work, you can install again using sudo, you dont need to remove the old version first for it to work

Can't start Jupyter Notebook in Linux (Ubuntu)

It says it installed Jupyter Notebook correctly, but when I launch it I get the error in the image:
The installation I used was:
pip
sudo apt-get install python3-pip
Then Pandas
sudo pip3 install pandas
then Jupyter notebook
sudo pip3 install Jupyter
Does it have anything to do with the version of Python (3 vs 2)?
How do I get Jupyter Notebook to start?
I had similar problems firing jupyter notebook on Ubuntu 18.4.x
Since jupyter notebook in itself requires another installation we need to install it. So I used this command and it worked please try and see if it works for you
#user-VirtualBox:~$ sudo apt install jupyter-notebook
It will ask for any password if you have set for Ubuntu once you enter this you should see
Reading package lists.. Done
Building dependency tree
...
...
etc
Once installation completed, type at prompt
#user-VirtualBox:~$ jupyter-notebook
You'll notice that jupyter's notebook system will automatically open Mozilla Firefox and it's ready go.
Let me know how it works.
Thanks

How to make Jupyter Notebook to point to the same Python installation as Terminal on Ubuntu?

I am on a Ubuntu machine. I installed Jupyter Notebook using the following command.
sudo snap install jupyter
But Jupyter cannot find any of the installed python packages which were installed using terminal. I checked if jupyter and terminal are pointing to same python installation using this code.
import sys; print(sys.executable)
Terminal shows this output.
'/usr/bin/python3'
And Jupyter shows this one.
'/snap/jupyter/6/bin/python'
Now I want the jupyter to point the same installation path as the terminal shows. How can I do that?
your jupyter is not placed in default packages location due to installing it with snap. install jupyter with pip this way: pip install jupyter
if you dont have pip then download it. it usually is included in python package

Categories