Skip to the content.

Pipenv

The virtual environment manager for Python, with pip and venv.

pipx install pipenv

or

pip install pipenv

Create Virtual Environments

cd <project-dir>
pipenv --python <x.y>

# For example:
pipenv --python 3.12

# or default version:
pipenv --three

Remove Virtual Environments

pipenv --rm

Install Packages/Dependencies

pipenv install <pkg ...>
pipenv install --dev <pkg ...>  # for development

Install All Packages/Dependencies

pipenv install

If you want to install a local setup.py:

pipenv install -e .

Uninstall Packages/Dependencies

pipenv uninstall <pkg ...>
pipenv uninstall --dev <pkg ...>  # for development

Upgrade All Packages/Dependencies

pipenv update

Run

pipenv run <python-cmd>

Examples:

pipenv run python a.py

pipenv run django-admin startproject a
pipenv run python manage.py runserver

pipenv run uwsgi a.ini

Deploy a Project

pipenv sync

Package Indexes (Mirror)

pipenv --pypi-mirror https://mirrors.aliyun.com/pypi/simple/ <cmd>

References