How to Install specific package versions with pip and Python

In this post you can find how to install specific package versions with pip and Python.

(1) Install specific package version in Python

pip install moviepy==1.0.2

(2) Install package between two versions

pip install 'moviepy>=1.3.0,<2.0.0'

(3) Install package ignore installed

pip install -Iv moviepy==1.2.2

where:

  • -I - ignore installed package
  • -v - verbose - will give more output
  • -Iv is combining two flags into one

(4) Upgrade or downgrade to specific Python version

pip install 'moviepy==2.0.0' --force-reinstall

(5) Install specific pre-release version in Python

pip install 'moviepy>=1.0.3' --pre

To check which is the installed version of a given Python package use:

from importlib.metadata import version
version('moviepy')

result:

'2.0.0.dev2'

You can read more about pip install here:

Share Tweet Send
0 Comments
Loading...
You've successfully subscribed to SoftHints - Python, Data Science and Linux Tutorials
Great! Next, complete checkout for full access to SoftHints - Python, Data Science and Linux Tutorials
Welcome back! You've successfully signed in
Success! Your account is fully activated, you now have access to all content.