invl / pip-autoremove

Remove a package and its unused dependencies.
Other
618 stars 42 forks source link

pkg_resources.DistributionNotFound for six #23

Closed konomikitten closed 6 years ago

konomikitten commented 6 years ago

It seems pip-autoremove needs a Require for six.

$ pip-autoremove
Traceback (most recent call last):
  File "/usr/local/bin/pip-autoremove", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python2.7/dist-packages/pip_autoremove.py", line 106, in main
    autoremove(args, yes=opts.yes)
  File "/usr/local/lib/python2.7/dist-packages/pip_autoremove.py", line 21, in autoremove
    dead = list_dead(names)
  File "/usr/local/lib/python2.7/dist-packages/pip_autoremove.py", line 29, in list_dead
    graph = get_graph()
  File "/usr/local/lib/python2.7/dist-packages/pip_autoremove.py", line 89, in get_graph
    for req in requires(dist):
  File "/usr/local/lib/python2.7/dist-packages/pip_autoremove.py", line 95, in requires
    return map(get_distribution, dist.requires())
  File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 476, in get_distribution
    dist = get_provider(dist)
  File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 352, in get_provider
    return working_set.find(moduleOrReq) or require(str(moduleOrReq))[0]
  File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 895, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 781, in resolve
    raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'six' distribution was not found and is required by the application
$ pip2 show pip-autoremove
Name: pip-autoremove
Version: 0.9.1
Summary: Remove a package and its unused dependencies
Home-page: https://github.com/invl/pip-autoremove
Author: UNKNOWN
Author-email: UNKNOWN
License: Apache License 2.0
Location: /usr/local/lib/python2.7/dist-packages
Requires:
akashpurandare commented 6 years ago

It does not just happen for six but for all the dependencies as well. We could probably add all the dependencies in the setup script. For the time being @KonomiKitten , just install six using pip.

konomikitten commented 6 years ago

@akashp1997 that's what I ended up doing be nice if the setup script had dependencies as you suggest, thanks for your time. I'm going to close this in favour of #11.