What IS Pipenv
Short introduction to Pipenv
Pipenv is a dependency manager for Python projects similar to Npm/Yarn for Node that provides more features than his older brother pip. Pipenv aims to help users manage environments, dependencies, and imported packages on the command line. While PIP alone is often sufficient for personal use, Pipenv is recommended for collaborative projects as it’s a higher-level tool that simplifies dependency management for common use cases.
How to use Pipenv
1
$ pip install pipenv
Copied!
Once pipenv is installed we can start using it in our projects. To install Django for instance, we must type:
1
$ pipenv install django
Copied!
This command will create automatically a virtual environment and install Django package.
Start a shell
1
$ pipenv shell
Copied!
Run a Python script
1
$ pipenv run python hello.py
Copied!
To use an exiting requirements.txt with pipenv:
1
pipenv install requirements.txt
Copied!
This will create a Pipfile and install the specified requirements. Consider your project upgraded!
​

Resources

Last modified 5mo ago
Copy link