📅 2013-Jun-26 ⬩ ✍️ Ashwin Nanjappa ⬩ 🏷️ cheatsheet, pip ⬩ 📚 Archive
Installing and managing packages of Python is a pain. Many popular Python packages are available for installation from Ubuntu repositories, but they are old versions.
The most convenient way to install, uninstall and manage Python packages is Pip.
pip is the usually the Python2 tool. pip3 is the Python3 tool. All the commands in this post will use pip, but they apply the same to pip3.
pip and pip3 can be installed from Ubuntu repositories:
$ sudo apt install python-pip python3-pip
$ sudo pip install foobar
This installs the package files to /usr/local/lib/python2.x/site-packages
for pip and to /usr/local/lib/python3.x/site-packages
for pip3.
$ pip install --user foobar
This installs the package files to ~/.local/lib/python2.x/site-packages
.
$ sudo pip uninstall foobar
$ pip uninstall --user foobar
$ pip install --upgrade foobar
$ pip list
$ pip search foobar
$ pip show -f foobar