Jupyter Notebook - Python 3 kernel - python

I have Jupyter Notebook installed and working. However it only has python 2 kernel.
I tried reinstalling Anaconda with Python 3.6 version of python, which worked fine (apart from deleting all my environments, etc.), but no change in relation to the kernels available for Jupyter.
I have tried installing jupyter using pip (the solution to this question), but I get the error message Requirement already satisfied: jupyter in c:\users\username\anaconda2\lib\site-packages
Any ideas?

Are you using pip3 install jupyter?
a more robust solution would be to isolate your environments with something like pipenv.
pip install pipenv
pipenv install --three
this will install a virtual environment with python3
install packages
pipenv install jupyter
activate the env
pipenv shell
start the notebook
jupyter notebook
You should be able to see the python3 option now.

Related

How do you completely uninstall jupyter notebook and jupyterlab from a mac when standard uninstall commands have no effect?

This has been asked many times - but I cannot for the life of me get rid of jupyter notebook/jupyterlab. I want to not be able to run a jupyter notebebook so that I can re-install everything.
I have tried the simple
pip uninstall jupyterlab pip uninstall notebook pip uninstall jupyter also with pip3 options
I have tried
$ pip3 install pip-autoremove
$ pip-autoremove jupyter -y
and changed pip3 for pip in case that made a difference.
I have followed what has been suggested with this answer
The output to which jupyter is /usr/local/bin/jupyter. I tried sudo /usr/local/bin/python -m pip uninstall jupyter following the comment answer this question.
Whenever I try remove it I just get Skipping jupyter as it is not installed. errors, yet if you run jupyter notebook it runs, and which jupyter continues to return a result.
It was suggested that I re-install Python3, but Jupyter Notebook is running Python2 (on a mac, so can't get rid of that), and I can't uninstall Python3 either following any instructions I can find.
Is there any way to get rid of this program from a mac when all the above fail to do anything?
Far as I know it was installed with pip, but I also checked if it was installed through conda (conda not recognised as a command)
I am running macOS Mojave Version 10.14.6. Python versions are
$ python --version
Python 2.7.15
$ python3 --version
Python 3.6.5

Uninstalled all pip, Homebrew, and Anaconda packages, but Jupyter Notebook still works

I installed Jupyter either through pip, Homebrew, or Anaconda. My packages and stuff are all getting messed up, so I want to completely start over from scratch as if I got a new computer. I followed instructions for uninstall pip, Homebrew, and Anaconda packages, but running jupyter notebook in Terminal still works.
Any help to kind of reset my computer?
Uninstalling the installing software (like pip, homebrew, or anaconda) won't uninstall things you installed with it. What to do to fix this depends on what you used to install jupyter notebook, but the first step is to reinstall the installer you used. Then:
If you used pip, get pip again and run this command:
pip uninstall jupyter
You might have to do this instead:
python3 -m pip uninstall jupyter
If you used Homebrew, do this:
brew uninstall jupyter
If you used Anaconda you should do this (from this answer):
conda remove jupyter jupyter-client jupyter-console jupyter-core

jupyter notebook installation issue using pip

I had a problem with jupyter notebook. Every time I started a notebook, kernel died.
So, I decided to uninstall jupyter notebook using pip:
pip uninstall jupyter notebook
After successful uninstallation, I installed again, using same pip:
pip install jupyter notebook
Then, as usually, I typed in cmd:
jupyter notebook
But got this error:
'jupyter' is not recognized as an internal or external command,
operable program or batch file.
So I checked the location of IPython, and found out that now the right file, which I want to call is jupyter-notebook, which different from jupyter notebook by dash sign. If I run jupyter-notebook from cmd everything works.
Can anyone explain, what happened and why the file now called jupyter-notebook?
Thank You
Because pip uses the legacy Python 2.
Use pip3 to install:
pip3 install --upgrade pip
pip3 install jupyter
jupyter notebook #to start jupyter notebook
I highly recommend installing Anaconda.
Download Anaconda here.
Then use :
bash
to install it.
Good Luck.
A solution without installing Anaconda, or conda:
sudo easy_install pip==20.3.4
pip2 install virtualenv
virtualenv jupyter
source jupyter/bin/activate
pip2 install jupyter
jupyter notebook
This solution was tested on:
Distributor ID: Ubuntu
Description: Ubuntu 16.04.7 LTS
Release: 16.04
Codename: xenial
It was run on 32bit Chromenotebook, with Firefox vs NetSurf installed on xenial
Jupyter notebook will be open automatically. However, everytime loging in on Jupiter again, at first source needs to be activated:
source jupyter/bin/activate
and then:
jupyter notebook
to start
I recommend that you always use conda instead of pip to install the Jupyter Notebook.
In your case, for example, I will recommend:
conda install jupyter notebook
and not pip install jupyter notebook I can see that most of the problems that you described there are environment related and hence you can often run into environment issues while using pip to install jupyter

How to uninstall jupyter in Windows?

This question have been asked a handful of times but none of the answers I have found have helped me at all.
I installed jupyter in my local Python 2.7 enviroment. Then installed Anaconda3 to run Python 3.6 and because the Conda distribution supports some packages I could not install locally via pip.
However the existing Python 2.7 jupyter installation is clashing with the Anaconda one. As I mentioned do not seem to be able uninstall jupyter via any of the methods I could find, and pip uninstall jupyter simply outputs Cannot uninstall requirement jupyter, not installed.
How can I uninstal jupyter so only the Anaconda one exists in my machine?

How to uninstall python jupyter correctly?

I have jupyter installed with python3.5 on my Mac OSX, but I want the python2.7 version. So, I basically need to uninstall the 3.5 version, and reinstall the 2.7 version.
But for some reason I can't uninstall the 3.5 version. I tried sudo python3 -m pip uninstall jupyter, and you can see the results below:
✔ ~/current/directory
20:08 $ which jupyter
/Library/Frameworks/Python.framework/Versions/3.5/bin/jupyter
✔ ~/current/directory
20:08 $ sudo python3 -m pip uninstall jupyter
The directory '/Users/<username>/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Cannot uninstall requirement jupyter, not installed
The directory '/Users/<username>/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
You are using pip version 8.1.1, however version 8.1.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
✘-1 ~/current/directory
20:09 $ which jupyter
/Library/Frameworks/Python.framework/Versions/3.5/bin/jupyter
...as you can see above, the which jupyter command still returns a valid path, AND not only that. I'm still able to launch jupyter notebook from the command line, and it opens a notebook.
How do I correctly get rid of my existing version of jupyter ? OR, if someone knows how to ADD a python2 kernel to my existing jupyter, that would be fine too. Is that possible?
All I can think of is to manually kill the files and subfolders inside of /Library/Frameworks/Python.framework/Versions/3.5/bin/, but this seems unnecessarily brutal?
The answer over here solved my problem: https://stackoverflow.com/a/42277762/8057434
I'll just summarize what to do.
Run
conda uninstall notebook nbconvert nbformat ipykernel ipywidgets qtconsole traitlets tornado jupyter_* ipython_genutils jinja2 -y
in your terminal.
You can use pip uninstall instead of conda uninstall if you aren't using anaconda.
From your home folder, delete ~/AnacondaProjects. After that remove the export of Anaconda environment variable from your bash profile ~/.bashrc .
Use pip3 instead of pip
pip3 uninstall jupyter
You can install for both python 2 and python 3 on the same computer as long as you use the correct pip version
I have jupyter installed with python3.5 on my Mac OSX, but I want the python2.7 version.
Anaconda is a great way to install python software that you need for specific projects.
Download from https://www.continuum.io/downloads#macos
as said, bash Anaconda2-4.3.1-MacOSX-x86_64.sh (the 2.7 version in your case)
go to the installed directory and type source bin/activate
This creates a command-line environment which has just the right level of libraries etc. Inside, you can install further data with f.ex. conda install numpy. To fix a version, use conda install numpy=1.10.
You should uninstall the jupyter-core, jupyter-console, jupyter-client seperately. After remove them all, these is no package found named jupyter.

Categories