I need to install virtualenv from an RPM.
I do this from the RPM's post-install script, with the following:

pip2 install pip --upgrade 
pip2 install virtualenv --upgrade

However, the pip2 install pip now upgrades PIP to version 10, which throws the following error on the pip2 install virtualenv command.

Cannot uninstall 'virtualenv'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.

A workaround I found is to do an rpm -e python-virtualenv prior to executing the above.
However, the rpm command cannot be executed from within a running rpm installation.

Any ideas how can I remove python-virtualenv using commands that are run from an RPM?

  • Your link goes to a Stack Overflow help page. I suspect you intended to link to something else. Please edit your question and fix the link. – Michael Hampton Jul 19 '18 at 19:17
  • Thanks @Michael, but I intended the link to point to [MCVE], so there won't be any complaints that I gave just the bare minimum. – boardrider Jul 21 '18 at 3:42
  • You have read the relevant github issues? – Michael Hampton Jul 21 '18 at 12:42
  • Yes, naturally. – boardrider Jul 23 '18 at 18:12
  • What about forcing? pip2 install virtualenv --upgrade --ignore-installed – hoefling Sep 17 '18 at 22:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.