To install the dependencies declared in your Pipfile, run:
pipfile install
This will install all dependencies specified in your Pipfile. Pipfile
You can specify the Python version your project requires directly in the Pipfile. Extras are specified via an extras array:
[requires]
python_version = "3.9"
# If you have requirements.txt
pipenv install -r requirements.txt
This section defines the Python interpreter requirements. Pipenv will automatically search for a matching Python version on your system or tell you if none exists. This eliminates the "Works on my machine" problem regarding Python base versions. To install the dependencies declared in your Pipfile
In simple terms, a Pipfile is a configuration file that lists your project's dependencies. It replaces requirements.txt and requirements.dev.txt (or similar patterns) by merging them into a single, structured file.
Unlike a plain text requirements.txt, a Pipfile is written in TOML (Tom's Obvious, Minimal Language), a human-readable format that also allows for structured data. This structure allows it to do two crucial things that requirements.txt cannot:
Alongside the Pipfile, Pipenv generates a Pipfile.lock. This lock file is the critical counterpart: it pins every single package to an exact, hash-verified version. The Pipfile says "I want Django >= 3.2," while the Pipfile.lock says "We are using Django 4.1.7, its hash is XYZ, and it requires asgiref 3.6.0."