invl / pip-autoremove

Remove a package and its unused dependencies.
Other
620 stars 43 forks source link

VersionConflict: Unable to autoremove awscli #27

Open acarl005 opened 4 years ago

acarl005 commented 4 years ago

I have a functioning installation of the awscli package.

$ pip install awscli
Requirement already satisfied: awscli in ./miniconda3/lib/python3.7/site-packages (1.16.189)
Requirement already satisfied: s3transfer<0.3.0,>=0.2.0 in ./miniconda3/lib/python3.7/site-packages (from awscli) (0.2.1)
Requirement already satisfied: PyYAML<=5.1,>=3.10; python_version != "2.6" in ./miniconda3/lib/python3.7/site-packages (from awscli) (5.1)
Requirement already satisfied: docutils>=0.10 in ./miniconda3/lib/python3.7/site-packages (from awscli) (0.14)
Requirement already satisfied: colorama<=0.3.9,>=0.2.5 in ./miniconda3/lib/python3.7/site-packages (from awscli) (0.3.9)
Requirement already satisfied: rsa<=3.5.0,>=3.1.2 in ./miniconda3/lib/python3.7/site-packages (from awscli) (3.4.2)
Requirement already satisfied: botocore==1.12.179 in ./miniconda3/lib/python3.7/site-packages (from awscli) (1.12.179)
Requirement already satisfied: pyasn1>=0.1.3 in ./miniconda3/lib/python3.7/site-packages (from rsa<=3.5.0,>=3.1.2->awscli) (0.4.4)
Requirement already satisfied: python-dateutil<3.0.0,>=2.1; python_version >= "2.7" in ./miniconda3/lib/python3.7/site-packages (from botocore==1.12.179->awscli) (2.8.0)
Requirement already satisfied: jmespath<1.0.0,>=0.7.1 in ./miniconda3/lib/python3.7/site-packages (from botocore==1.12.179->awscli) (0.9.4)
Requirement already satisfied: urllib3<1.26,>=1.20; python_version >= "3.4" in ./miniconda3/lib/python3.7/site-packages (from botocore==1.12.179->awscli) (1.23)
Requirement already satisfied: six>=1.5 in ./miniconda3/lib/python3.7/site-packages (from python-dateutil<3.0.0,>=2.1; python_version >= "2.7"->botocore==1.12.179->awscli) (1.11.0)
$ aws
usage: aws [options] <command> <subcommand> [<subcommand> ...] [parameters]
To see help text, you can run:

  aws help
  aws <command> help
  aws <command> <subcommand> help
aws: error: the following arguments are required: command

However, when I try to remove it, I get this error:

$ pip-autoremove awscli
Traceback (most recent call last):
  File "/Users/andy/miniconda3/bin/pip-autoremove", line 8, in <module>
    sys.exit(main())
  File "/Users/andy/miniconda3/lib/python3.7/site-packages/pip_autoremove.py", line 106, in main
    autoremove(args, yes=opts.yes)
  File "/Users/andy/miniconda3/lib/python3.7/site-packages/pip_autoremove.py", line 21, in autoremove
    dead = list_dead(names)
  File "/Users/andy/miniconda3/lib/python3.7/site-packages/pip_autoremove.py", line 29, in list_dead
    graph = get_graph()
  File "/Users/andy/miniconda3/lib/python3.7/site-packages/pip_autoremove.py", line 89, in get_graph
    for req in requires(dist):
  File "/Users/andy/miniconda3/lib/python3.7/site-packages/pkg_resources/__init__.py", line 476, in get_distribution
    dist = get_provider(dist)
  File "/Users/andy/miniconda3/lib/python3.7/site-packages/pkg_resources/__init__.py", line 352, in get_provider
    return working_set.find(moduleOrReq) or require(str(moduleOrReq))[0]
  File "/Users/andy/miniconda3/lib/python3.7/site-packages/pkg_resources/__init__.py", line 638, in find
    raise VersionConflict(dist, req)
pkg_resources.VersionConflict: (oauth2client 4.1.3 (/Users/andy/miniconda3/lib/python3.7/site-packages), Requirement.parse('oauth2client<4.0dev,>=2.0.0'))

I'm on MacOS Catalina.

$ python --version
Python 3.7.0
$ pip-autoremove --version
pip-autoremove 0.9.1
ghost commented 4 years ago

Same issue here attempting to remove opendrop. Although I installed it with the pip3 command. I'm on macOS Catalina as well (10.15.4). Also python --version returns Python 2.7.16 and my path to the lib and bin folders are in /usr/local/ instead of ~.

tresni commented 4 years ago

Sounds like #16 is the solution. If so, you can install directly from my fork tresni/pip-autoremove with pip install git+https://github.com/tresni/pip-autoremove.git

nataliastanko commented 4 years ago

Is it going to be merged?

jnawk commented 3 years ago

Currently has merge conflicts.

tresni commented 2 years ago

My fork has been updated with some newer commits and integrates a number of bug fixes.

tresni commented 2 years ago

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