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.11

# or default version:
pipenv --three

Remove Virtual Environments

pipenv --rm

Install Packages

pipenv install <pkg ...>

Install Packages for Development

pipenv install --dev <pkg ...>

Install All Packages

pipenv install

If you want to install a local setup.py:

pipenv install -e .

Uninstall Packages

pipenv uninstall <pkg ...>

Uninstall Packages for Development

pipenv uninstall --dev <pkg ...>

Upgrade All Packages

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

Use Mirror

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

References