How do I update a Python package?

thompson picture thompson · Mar 3, 2011 · Viewed 508k times · Source

I'm running Ubuntu 9:10 and a package called M2Crypto is installed (version is 0.19.1). I need to download, build and install the latest version of the M2Crypto package (0.20.2).

The 0.19.1 package has files in a number of locations including (/usr/share/pyshared and /usr/lib/pymodules.python2.6).

How can I completely uninstall version 0.19.1 from my system before installing 0.20.2?

Answer

princelySid picture princelySid · Nov 28, 2014

The best way I've found is to run this command from terminal

sudo pip install [package_name] --upgrade

sudo will ask to enter your root password to confirm the action.


Note: Some users may have pip3 installed instead. In that case, use

sudo pip3 install [package_name] --upgrade