101

I have been trying to uninstall jupyter

I have tried the following commands

pip uninstall jupyter
pip3 uninstall jupyter

and

rm -rf /Users/$user/Library/Jupyter/*

Even after running all these commands when I type jupyter in the terminal I get the following message

usage: jupyter [-h] [--version] [--config-dir] [--data-dir] [--runtime-dir]
               [--paths] [--json]
               [subcommand]
jupyter: error: one of the arguments --version subcommand --config-dir --data-dir --runtime-dir --paths is required

What exactly is going wrong and why am I still able to use the command?

Mel
  • 5,837
  • 10
  • 37
  • 42
jigar surana
  • 1,186
  • 2
  • 8
  • 10
  • 2
    Can you add the output of `which -a jupyter`? – cel Oct 10 '15 at 09:21
  • 1
    it gives me **/Library/Frameworks/Python.framework/Versions/3.5/bin/jupyter** – jigar surana Oct 10 '15 at 09:33
  • 3
    `sudo /Library/Frameworks/Python.framework/Versions/3.5/bin/python -m pip uninstall jupyter` – cel Oct 10 '15 at 09:34
  • 3
    Suppose my install path gives me /usr/local/bin/jupyter, and running the above command does not work for me; any other recommendation? the Debian package manager _aptitude_ does not show me any jupyter-* package installed. Thanks. – Orco Mar 20 '18 at 21:13
  • "python3 -m pip uninstall -y jupyter jupyter_core jupyter-client jupyter-console jupyterlab_pygments notebook qtconsole nbconvert nbformat jupyterlab-widgets nbclient" - Copied from @Rahual Bhardwaj answer below – Dhiren Hamal Feb 26 '22 at 14:35

14 Answers14

130

If you don't want to use pip-autoremove (since it removes dependencies shared among other packages) and pip3 uninstall jupyter just removed some packages, then do the following:

Copy-Paste:

sudo may be needed as per your need.

python3 -m pip uninstall -y jupyter jupyter_core jupyter-client jupyter-console jupyterlab_pygments qtconsole notebook nbconvert nbformat nbclassic nbclient jupyterlab-widgets jupyter-events jupyter-server jupyter-server-terminals 

Note:

The above command will only uninstall jupyter specific packages. I have not added other packages to uninstall since they might be shared among other packages (eg: Jinja2 is used by Flask, ipython is a separate set of packages themselves, tornado again might be used by others).

In any case, all the dependencies are mentioned below(as of 21 Nov, 2020. jupyter==4.4.0 )

If you are sure you want to remove all the dependencies, then you can use Stan_MD's answer.

argon2-cffi
argon2-cffi-bindings
async-generator
attrs
backcall
bleach
cffi
dataclasses
decorator
defusedxml
entrypoints
importlib-metadata
ipykernel
ipython
ipython-genutils
ipywidgets
jedi
Jinja2
jsonschema
jupyter
jupyter-client
jupyter-console
jupyter-core
jupyterlab-pygments
jupyterlab-widgets
MarkupSafe
mistune
nbclient
nbconvert
nbformat
nest-asyncio
notebook
packaging
pandocfilters
parso
pexpect
pickleshare
prometheus-client
prompt-toolkit
ptyprocess
pycparser
Pygments
pyparsing
pyrsistent
python-dateutil
pyzmq
qtconsole
QtPy
Send2Trash
six
terminado
testpath
tornado
traitlets
typing-extensions
wcwidth
webencodings
widgetsnbextension
zipp

Executive Edit:

pip3 uninstall jupyter
pip3 uninstall jupyter_core
pip3 uninstall jupyter-client
pip3 uninstall jupyter-console
pip3 uninstall jupyterlab_pygments
pip3 uninstall notebook
pip3 uninstall qtconsole
pip3 uninstall nbconvert
pip3 uninstall nbformat
Rahul Bharadwaj
  • 2,555
  • 2
  • 18
  • 29
  • 1
    Thanks a million. What about voila? – Fattie Aug 23 '22 at 16:02
  • @Fattie Couldn't find `voila` as a dependency .. am I missing something? – Rahul Bharadwaj Aug 23 '22 at 17:08
  • 1
    Thanks - you know what, I guess when folks install jupyter, they inevitably also install voila. Just as you say, it seems to be "just a separate thing". I'm clueless so I thought I'd ask an expert heh! So I've just uninstalled it separately. TY !!! – Fattie Aug 24 '22 at 11:18
  • Ahh ok, no worries! :) – Rahul Bharadwaj Aug 24 '22 at 16:19
  • Copy all the dependencies in a file, say, requirements.txt. Then run command ```pip3 uninstall -r requirements.txt -y``` . Add these 3 line in the txt file also- ```jupyter-events jupyter_server jupyter_server_terminals ``` – Khondaker tanvir mahmud Jun 27 '23 at 21:03
84

When you $ pip install jupyter several dependencies are installed. The best way to uninstall it completely is by running:

  1. $ pip install pip-autoremove
  2. $ pip-autoremove jupyter -y

Kindly refer to this related question.

pip-autoremove removes a package and its unused dependencies. Here are the docs.

Community
  • 1
  • 1
Stan_MD
  • 1,011
  • 9
  • 8
25

Try pip uninstall jupyter_core. Details below:

I ran into a similar issue when my jupyter notebook only showed Python 2 notebook. (no Python 3 notebook)

I tried to uninstall jupyter by pip unistall jupyter, pi3 uninstall jupyter, and the suggested pip-autoremove jupyter -y.

Nothing worked. I ran which jupyter, and got /home/ankit/.local/bin/jupyter

The file /home/ankit/.local/bin/jupyter was just a simple python code:

#!/usr/bin/python3

# -*- coding: utf-8 -*-
import re
import sys

from jupyter_core.command import main

if __name__ == '__main__':
    sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
    sys.exit(main())

Tried to uninstall the module jupyter_core by pip uninstall jupyter_core and it worked.

Reinstalled jupyter with pip3 install jupyter and everything was back to normal.

Ankit S
  • 505
  • 5
  • 9
  • Amazing. This answer clean up my 2 days headache. `pip uninstall jupyter_core` runs perfectly in M2 MacOS. – Jay Lim Aug 26 '23 at 07:47
16

If you installed Jupiter notebook through anaconda, this may help you:

conda uninstall jupyter notebook
Mel
  • 5,837
  • 10
  • 37
  • 42
NoahCao
  • 233
  • 2
  • 7
10

If you are using jupyter notebook, You can remove it like this:

pip uninstall notebook

You should use conda uninstall if you installed it with conda.

Dharma
  • 2,425
  • 3
  • 26
  • 40
3

For python 3.7:

  1. On windows command prompt, type: "py -m pip install pip-autoremove". You will get a successful message.
  2. Change directory, if you didn't add the following as your PATH: cd C:\Users{user_name}\AppData\Local\Programs\Python\Python37-32\Scripts To know where your package/application has been installed/located, type: "where program_name" like> where jupyter If you didn't find a location, you need to add the location in PATH.

  3. Type: pip-autoremove jupyter It will ask to type y/n to confirm the action.

3

In pip3

pip3 uninstall jupyterlab

J11
  • 455
  • 4
  • 8
3

In my case, I have installed it via pip3 on mac.

pip3 uninstall notebook
Ankit Kumar Rajpoot
  • 5,188
  • 2
  • 38
  • 32
3

For Mac OS, you may use the below command in order to remove files manually.

sudo rm -rf /usr/local/bin/jupyter
Amin Khodamoradi
  • 392
  • 1
  • 6
  • 18
1

I also had the same issue I installed jupyter-lab on my system after I thought I should install it on virtual env. So I tried to uninstall it but pip did not remove its dependencies. I also tried pip-autoremove but It does not found jupyter. So I found an easy solution. first I create a virtual env

python -m venv env

after that activate it

source env/bin/activate

Now install jupyter in virtual env

pip install jupyterlab

after that I create requirements.txt

pip freeze > requirements.txt

now we have jupyter and all its dependencies in a txt file so deactivate virtual env

deactivate

Now we can remove all of the dependencies of jupyter by this txt file.

pip uninstall -r requirements.txt

I found this is the easiest way to remove jupyter now you can also delete jupyter virtual env.

1

Use pip uninstall jupyter notebook if you are using python 3.9+

1

Use $ pip3 install pip-autoremove or $ pip-autoremove jupyter -y to clear all.

check:

pip3 freeze | grep jupyter
which jupyter

And if nothing is back, then which means it is all cleared.

According to this link

Doggy
  • 35
  • 9
0

Did you install jupyter or is it part of the default install? See below. If the default install, just leave it alone. Macos has lots of stuff you will never use, but removing it might just break something because Apple...

From the Python documentation

The Apple-provided build of Python is installed in /System/Library/Frameworks/Python.framework and /usr/bin/python, respectively. You should never modify or delete these, as they are Apple-controlled and are used by Apple- or third-party software. Remember that if you choose to install a newer Python version from python.org, you will have two different but functional Python installations on your computer, so it will be important that your paths and usages are consistent with what you want to do.

dsagman
  • 481
  • 1
  • 8
-1

python3 -m pip uninstall -y jupyter jupyter_core jupyter-client jupyter-console jupyterlab_pygments notebook qtconsole nbconvert nbformat jupyterlab-widgets nbclient

The above code is excatly correct, but in place of python3 it must be written

pip3 -m pip uninstall -y jupyter jupyter_core jupyter-client jupyter-console jupyterlab_pygments notebook qtconsole nbconvert nbformat jupyterlab-widgets nbclient