PIP
Overview of the Standard Python Package Manager, PIP.
Introduction
The standard Python package manager is pip
. It is ideal for quickly starting Python projects, like simple scripts or small projects with few dependencies. While capable of handling larger projects, tools like poetry
are ideal for larger projects with complex dependencies.
The following notes assume:
Python 3
MacOS
An alias in
bash
profile to mappython
topython3
.
Setup
The following is a step-by-step process for setting up a virtual environment in my-project
and installing dependencies in it with pip
.
cd
into your project directory.
Create the virtual environment named
env
.
Activate the virtual environment.
Install dependencies.
Commands
The following is a list of common commands used when managing a project with pip
.
Activate Virtual Environment
Deactivate Virtual Environment
Uninstall a Package
List Installed Packages
Create a requirements.txt File
Install Packages from a requirements.txt File
Pitfalls & Solutions
The following are common pitfalls when working with pip
and their solutions.
Last updated
Was this helpful?