Python - Hello, Pip!

pip logo pixel art

Pip is the packager manager for python.


Pip Installation

Windows

$ curl https://bootstrap.pypa.io/get-pip.py | python -

⚠️ don't forget to add pip to env!


Linux(debian/ubuntu, arch-linux)

$ sudo apt install python-pip
$ sudo pacman -S python-pip

Basic commands

$ pip install <package-name>
$ pip install -r requirements.txt # <- install packages listed in requirements.txt
$ pip uninstall <package-name>
$ pip list
$ pip freeze # <- requirements.txt format

Virtual Environment

You can create a virtual environment to isolate dependencies for each project.

$ pip install virtualenv

Create a environment

$ virtualenv <path-to-folder>

Activate a environment

$ <path-to-folder>/Scripts/activate # <- Windows
$ source <path-to-folder>/bin/activate # <- Linux

Deactivate a environment

$ deactivate