Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pip-autoremove on Fedora 28: pkg_resources.DistributionNotFound #24

Open
PlatonB opened this issue Oct 27, 2018 · 4 comments
Open

pip-autoremove on Fedora 28: pkg_resources.DistributionNotFound #24

PlatonB opened this issue Oct 27, 2018 · 4 comments

Comments

@PlatonB
Copy link

PlatonB commented Oct 27, 2018

sudo pip-autoremove seaborn -y
<...>
Traceback (most recent call last):
File "/usr/local/bin/pip-autoremove", line 11, in
sys.exit(main())
File "/usr/local/lib/python3.6/site-packages/pip_autoremove.py", line 106, in main
autoremove(args, yes=opts.yes)
File "/usr/local/lib/python3.6/site-packages/pip_autoremove.py", line 21, in autoremove
dead = list_dead(names)
File "/usr/local/lib/python3.6/site-packages/pip_autoremove.py", line 29, in list_dead
graph = get_graph()
File "/usr/local/lib/python3.6/site-packages/pip_autoremove.py", line 89, in get_graph
for req in requires(dist):
File "/usr/local/lib/python3.6/site-packages/pkg_resources/init.py", line 471, in get_distribution
dist = get_provider(dist)
File "/usr/local/lib/python3.6/site-packages/pkg_resources/init.py", line 347, in get_provider
return working_set.find(moduleOrReq) or require(str(moduleOrReq))[0]
File "/usr/local/lib/python3.6/site-packages/pkg_resources/init.py", line 891, in require
needed = self.resolve(parse_requirements(requirements))
File "/usr/local/lib/python3.6/site-packages/pkg_resources/init.py", line 777, in resolve
raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'tornado>=4' distribution was not found and is required by the application

@ShamrockLee
Copy link

ShamrockLee commented Jul 8, 2019

I got the same error when trying to remove the package jupyter in Python 3.6 in Linux Mint 19.1.

Here is the installation of jupyter:

$ sudo -H python3 -m pip install jupyter
Collecting jupyter
  Using cached https://files.pythonhosted.org/packages/83/df/0f5dd132200728a86190397e1ea87cd76244e42d39ec5e88efd25b2abd7e/jupyter-1.0.0-py2.py3-none-any.whl
Requirement already satisfied: jupyter-console in /usr/local/lib/python3.6/dist-packages (from jupyter) (6.0.0)
Requirement already satisfied: qtconsole in /usr/local/lib/python3.6/dist-packages (from jupyter) (4.4.3)
Collecting notebook (from jupyter)
  Using cached https://files.pythonhosted.org/packages/f6/36/89ebfffc9dd8c8dbd81c1ffb53e3d4233ee666414c143959477cb07cc5f5/notebook-5.7.8-py2.py3-none-any.whl
Requirement already satisfied: ipywidgets in /usr/local/lib/python3.6/dist-packages (from jupyter) (7.4.2)
Requirement already satisfied: ipykernel in /usr/local/lib/python3.6/dist-packages (from jupyter) (5.1.0)
Collecting nbconvert (from jupyter)
  Downloading https://files.pythonhosted.org/packages/35/e7/f46c9d65f149271e47fca6ab084ef5c6e4cb1870f4c5cce6690feac55231/nbconvert-5.5.0-py2.py3-none-any.whl (447kB)
     |████████████████████████████████| 450kB 229kB/s 
Requirement already satisfied: pygments in /usr/local/lib/python3.6/dist-packages (from jupyter-console->jupyter) (2.3.1)
Requirement already satisfied: jupyter-client in /usr/local/lib/python3.6/dist-packages (from jupyter-console->jupyter) (5.2.4)
Requirement already satisfied: prompt-toolkit<2.1.0,>=2.0.0 in /usr/local/lib/python3.6/dist-packages (from jupyter-console->jupyter) (2.0.9)
Requirement already satisfied: ipython in /usr/local/lib/python3.6/dist-packages (from jupyter-console->jupyter) (7.4.0)
Requirement already satisfied: ipython-genutils in /usr/lib/python3/dist-packages (from qtconsole->jupyter) (0.2.0)
Requirement already satisfied: traitlets in /usr/lib/python3/dist-packages (from qtconsole->jupyter) (4.3.2)
Requirement already satisfied: jupyter-core in /usr/lib/python3/dist-packages (from qtconsole->jupyter) (4.4.0)
Collecting pyzmq>=17 (from notebook->jupyter)
  Downloading https://files.pythonhosted.org/packages/92/92/ea8f20560d5f1d0c6eb3c7c67ca72abfb97307f4e6494fc05cc7c37904cf/pyzmq-18.0.2-cp36-cp36m-manylinux1_x86_64.whl (1.1MB)
     |████████████████████████████████| 1.1MB 2.4MB/s 
Collecting nbformat (from notebook->jupyter)
  Using cached https://files.pythonhosted.org/packages/da/27/9a654d2b6cc1eaa517d1c5a4405166c7f6d72f04f6e7eea41855fe808a46/nbformat-4.4.0-py2.py3-none-any.whl
Collecting prometheus-client (from notebook->jupyter)
  Downloading https://files.pythonhosted.org/packages/b3/23/41a5a24b502d35a4ad50a5bb7202a5e1d9a0364d0c12f56db3dbf7aca76d/prometheus_client-0.7.1.tar.gz
Collecting terminado>=0.8.1 (from notebook->jupyter)
  Using cached https://files.pythonhosted.org/packages/a7/56/80ea7fa66565fa75ae21ce0c16bc90067530e5d15e48854afcc86585a391/terminado-0.8.2-py2.py3-none-any.whl
Collecting Send2Trash (from notebook->jupyter)
  Using cached https://files.pythonhosted.org/packages/49/46/c3dc27481d1cc57b9385aff41c474ceb7714f7935b1247194adae45db714/Send2Trash-1.5.0-py3-none-any.whl
Requirement already satisfied: jinja2 in /usr/local/lib/python3.6/dist-packages (from notebook->jupyter) (2.10.1)
Requirement already satisfied: tornado<7,>=4.1 in /usr/local/lib/python3.6/dist-packages (from notebook->jupyter) (6.0.2)
Requirement already satisfied: widgetsnbextension~=3.4.0 in /usr/local/lib/python3.6/dist-packages (from ipywidgets->jupyter) (3.4.2)
Requirement already satisfied: mistune>=0.8.1 in /usr/local/lib/python3.6/dist-packages (from nbconvert->jupyter) (0.8.4)
Requirement already satisfied: bleach in /usr/local/lib/python3.6/dist-packages (from nbconvert->jupyter) (3.1.0)
Requirement already satisfied: entrypoints>=0.2.2 in /usr/lib/python3/dist-packages (from nbconvert->jupyter) (0.2.3.post1)
Requirement already satisfied: testpath in /usr/lib/python3/dist-packages (from nbconvert->jupyter) (0.3.1)
Requirement already satisfied: defusedxml in /usr/local/lib/python3.6/dist-packages (from nbconvert->jupyter) (0.6.0)
Requirement already satisfied: pandocfilters>=1.4.1 in /usr/lib/python3/dist-packages (from nbconvert->jupyter) (1.4.2)
Requirement already satisfied: python-dateutil>=2.1 in /usr/local/lib/python3.6/dist-packages (from jupyter-client->jupyter-console->jupyter) (2.8.0)
Requirement already satisfied: wcwidth in /usr/lib/python3/dist-packages (from prompt-toolkit<2.1.0,>=2.0.0->jupyter-console->jupyter) (0.1.7)
Requirement already satisfied: six>=1.9.0 in /usr/local/lib/python3.6/dist-packages (from prompt-toolkit<2.1.0,>=2.0.0->jupyter-console->jupyter) (1.12.0)
Requirement already satisfied: pexpect; sys_platform != "win32" in /usr/local/lib/python3.6/dist-packages (from ipython->jupyter-console->jupyter) (4.7.0)
Requirement already satisfied: decorator in /usr/local/lib/python3.6/dist-packages (from ipython->jupyter-console->jupyter) (4.4.0)
Requirement already satisfied: jedi>=0.10 in /usr/local/lib/python3.6/dist-packages (from ipython->jupyter-console->jupyter) (0.13.3)
Requirement already satisfied: setuptools>=18.5 in /usr/local/lib/python3.6/dist-packages (from ipython->jupyter-console->jupyter) (41.0.1)
Requirement already satisfied: backcall in /usr/local/lib/python3.6/dist-packages (from ipython->jupyter-console->jupyter) (0.1.0)
Requirement already satisfied: pickleshare in /usr/local/lib/python3.6/dist-packages (from ipython->jupyter-console->jupyter) (0.7.5)
Requirement already satisfied: jsonschema!=2.5.0,>=2.4 in /usr/local/lib/python3.6/dist-packages (from nbformat->notebook->jupyter) (3.0.1)
Requirement already satisfied: ptyprocess; os_name != "nt" in /usr/local/lib/python3.6/dist-packages (from terminado>=0.8.1->notebook->jupyter) (0.6.0)
Requirement already satisfied: MarkupSafe>=0.23 in /usr/local/lib/python3.6/dist-packages (from jinja2->notebook->jupyter) (1.1.1)
Requirement already satisfied: webencodings in /usr/local/lib/python3.6/dist-packages (from bleach->nbconvert->jupyter) (0.5.1)
Requirement already satisfied: parso>=0.3.0 in /usr/local/lib/python3.6/dist-packages (from jedi>=0.10->ipython->jupyter-console->jupyter) (0.4.0)
Requirement already satisfied: attrs>=17.4.0 in /usr/local/lib/python3.6/dist-packages (from jsonschema!=2.5.0,>=2.4->nbformat->notebook->jupyter) (19.1.0)
Requirement already satisfied: pyrsistent>=0.14.0 in /usr/local/lib/python3.6/dist-packages (from jsonschema!=2.5.0,>=2.4->nbformat->notebook->jupyter) (0.14.11)
Installing collected packages: pyzmq, nbformat, prometheus-client, terminado, Send2Trash, nbconvert, notebook, jupyter
  Found existing installation: pyzmq 16.0.2
ERROR: Cannot uninstall 'pyzmq'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.

And here is how I try to remove it:

$ sudo -H pip-autoremove jupyter
Traceback (most recent call last):
  File "/usr/local/bin/pip-autoremove", line 10, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.6/dist-packages/pip_autoremove.py", line 106, in main
    autoremove(args, yes=opts.yes)
  File "/usr/local/lib/python3.6/dist-packages/pip_autoremove.py", line 21, in autoremove
    dead = list_dead(names)
  File "/usr/local/lib/python3.6/dist-packages/pip_autoremove.py", line 28, in list_dead
    start = set(map(get_distribution, names))
  File "/usr/local/lib/python3.6/dist-packages/pkg_resources/__init__.py", line 481, in get_distribution
    dist = get_provider(dist)
  File "/usr/local/lib/python3.6/dist-packages/pkg_resources/__init__.py", line 357, in get_provider
    return working_set.find(moduleOrReq) or require(str(moduleOrReq))[0]
  File "/usr/local/lib/python3.6/dist-packages/pkg_resources/__init__.py", line 900, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/usr/local/lib/python3.6/dist-packages/pkg_resources/__init__.py", line 786, in resolve
    raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'jupyter' distribution was not found and is required by the application

@ShamrockLee
Copy link

ShamrockLee commented Jul 8, 2019

There seem to be similar problems in issue #10.

@tresni
Copy link
Contributor

tresni commented Apr 11, 2020

#16 is likely your solution

@tresni
Copy link
Contributor

tresni commented Sep 17, 2021

Should be addressed by the merge of #42 and the new release, please close if that resolves your issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants