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

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

Closed
jxltom opened this Issue Nov 6, 2018 · 0 comments

Comments

Projects
None yet
1 participant
@jxltom
Collaborator

jxltom commented Nov 6, 2018

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!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment