11

I have a version of a package installed (e.g. transformers 3.4.0) I want to install an earlier one. I install with:

pip install transformers==3.1.0

When checking installed versions with

pip freeze

I see the version did not change.

2 Answers 2

24

Although not intuitive, --upgrade means to ignore the exact version and ignore the current one if not the same. So, you need to "upgrade" to the earlier version for example:

pip install --upgrade transformers==3.1.0
0
6

upgrade can be used for both downgrades or upgrades.

pip install --upgrade transformers==3.1.0

If you want to play it safe, you can

pip uninstall transformers
pip install --upgrade transformers==3.1.0

upgrade works with -t --target parameter as well.

pip install --target lib --upgrade transformers==3.1.0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.