Code Yarns ‍👨‍💻
Tech BlogPersonal Blog

pip cheatsheet

📅 2013-Jun-26 ⬩ ✍️ Ashwin Nanjappa ⬩ 📚 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.

$ 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