📜  pipenv - Python (1)

📅  最后修改于: 2023-12-03 15:03:46.923000             🧑  作者: Mango

Pipenv - Python

Pipenv is a tool for managing Python virtual environments and packages. It combines the functionality of pip (for package installation) and virtualenv (for creating virtual environments). Pipenv helps to minimize dependency conflicts and ensures consistent package installations across multiple environments.

Installation

Pipenv can be installed using pip:

$ pip install pipenv
Usage

To create a new virtual environment and automatically install the required packages from a project's Pipfile, run:

$ pipenv install

To activate the virtual environment, run:

$ pipenv shell

The Pipfile.lock file tracks the exact versions of installed packages, and can be used to recreate the environment later. To create a new virtual environment with the packages listed in a Pipfile.lock file, run:

$ pipenv install --ignore-pipfile

To install a new package and automatically update the Pipfile and Pipfile.lock files, run:

$ pipenv install <package_name>

To uninstall a package and remove it from the Pipfile and Pipfile.lock files, run:

$ pipenv uninstall <package_name>
Conclusion

Pipenv is a powerful tool for managing Python virtual environments and packages. It simplifies dependency management and ensures consistent package installations across multiple environments. Whether you are a beginner or an experienced Python developer, Pipenv can help improve your workflow and make package management less of a headache.