pip-autoremove icon indicating copy to clipboard operation
pip-autoremove copied to clipboard

pip-autoremove on Fedora 28: pkg_resources.DistributionNotFound

Open PlatonB opened this issue 6 years ago • 4 comments

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

PlatonB avatar Oct 27 '18 22:10 PlatonB

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 avatar Jul 08 '19 04:07 ShamrockLee

There seem to be similar problems in issue #10.

ShamrockLee avatar Jul 08 '19 04:07 ShamrockLee

#16 is likely your solution

tresni avatar Apr 11 '20 22:04 tresni

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

tresni avatar Sep 17 '21 16:09 tresni