Skip to content

Pipenv uninstall --all returns error when there is no installed packages in virtuanlenv #3170

Description

@jxltom

Issue description

In latest master branch, pipenv uninstall --all will returns error if the virtualenv is already fresh.

pipenv uninstall --all
Un-installing all packages from virtualenv...
Found 0 installed package(s), purging...
[pipenv.exceptions.UninstallError]:   File "/home/user/Documents/dev/pipenv/pipenv/vendor/click/core.py", line 555, in invoke
[pipenv.exceptions.UninstallError]:       return callback(*args, **kwargs)
[pipenv.exceptions.UninstallError]:   File "/home/user/Documents/dev/pipenv/pipenv/vendor/click/decorators.py", line 17, in new_func
[pipenv.exceptions.UninstallError]:       return f(get_current_context(), *args, **kwargs)
[pipenv.exceptions.UninstallError]:   File "/home/user/Documents/dev/pipenv/pipenv/cli/command.py", line 294, in uninstall
[pipenv.exceptions.UninstallError]:       ctx=ctx
[pipenv.exceptions.UninstallError]:   File "/home/user/Documents/dev/pipenv/pipenv/core.py", line 2120, in do_uninstall
[pipenv.exceptions.UninstallError]:       do_purge(allow_global=system)
[pipenv.exceptions.UninstallError]:   File "/home/user/Documents/dev/pipenv/pipenv/core.py", line 1170, in do_purge
[pipenv.exceptions.UninstallError]:       raise exceptions.UninstallError(installed, command, c.out + c.err, c.return_code)
[pipenv.exceptions.UninstallError]: Attempted to run command: $ "/home/user/.local/share/virtualenvs/saleor-boilerplate-JGSSEPfX/bin/pip" uninstall  -y
[pipenv.exceptions.UninstallError]: You must give at least one requirement to uninstall (see "pip help uninstall")
ERROR: Failed to uninstall package(s) set([u'wheel', u'pip', u'setuptools'])...

It is better to just skip purging and show success information for this case, such as following result.

pipenv uninstall --all
Un-installing all packages from virtualenv...
Found 0 installed package(s), purging...
Environment now purged and fresh!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions