invl/pip-autoremove

The 'cmd2' distribution was not found and is required by the application

iamtalhaasghar opened this issue · 8 comments

The issue is caused because cmd2 is not installed with pip-autoremove

Solution:

  • Add cmd2 as a dependency in setup.py file so cmd2 is installed automatically and this will fix the issue.

For now, any user who is facing this issue can manually install cmd2 with following command:
pip install cmd2

X-m7 commented

In my case in addition to cmd2 I also needed to install pyyaml.

Also brotli and email-validator...

cmd2 is not a requirement of pip-autoremove, nor are any of the packages mentioned here (pyyaml, brotli, or email-validator.) The only requirements for pip-autoremove are pip and setuptools which are basically defaults (though not actually part of the stdlib. Checkout my fork for an updated version of pip-autoremove that fixes many of the issues here.

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

I get this message:

The 'python-lsp-server' distribution was not found and is required by the application

with the new version. However:

  1. I can't see any functionality that's missing from pip-autoremove without that package. I just get the warning. Like you say, it doesn't appear to be a real requirement.
  2. Installing python-lsp-server does indeed make the warning go away.

It feels like this warning is not about pip-autoremove itself, but a side effect of checking one of the many installed packages. Is the cmd2 package warning in the title of this issue the same thing? A good fix for this would be for pip-autoremove to detect when this is happening (possibly difficult) and identify the package that is complaining.

Similarly, I get these helpful, but ambiguous messages from pip-autoremove:

jedi 0.18.0 is installed but jedi<0.18.0,>=0.17.2 is required
Redoing requirement with just package name...
PyPDF2 1.26.0 is installed but PyPDF2==1.24 is required
Redoing requirement with just package name...
unrar-cffi 0.2.1 is installed but unrar-cffi==0.1.0a5 is required
Redoing requirement with just package name...
natsort 7.1.1 is installed but natsort==3.5.2 is required
Redoing requirement with just package name...

Which package wants an older version of jedi? If a subprocess is producing that message then, again, this gets difficult, but if pip-autoremove is creating this message then mentioning which package wants an older version would be helpful.

Please test with #45 and let me know if that helps make it more obvious what is going on