Introduction to the

Pipenv is a python package management tool that manages both the Python virtual environment and Python dependencies.

use

Pipenv installation: Installed in the main environment, available globally

pip install pipenv
Copy the code

Creating a virtual environment: Create a virtual environment in the corresponding project file

pipenv install
Copy the code

Two files are generated: Pipfile and pipfile.lock

Modifying an image source:

  • Pipfile
[[source]] name = "pypi url =" https://pypi.doubanio.com/simple/ "#" key verify_ssl = true [dev - packages] [packages] Flask = "*" flask-login = "*" flask-mail = "*" [requires] python_version = "3.7"Copy the code

To activate the environment: Execute in the path of Pipfile and pipfile. lock files:

pipenv shell
Copy the code

Create a virtual environment based on an existing Pipfile or pipfil.lock

pipenv create from pipfile.lock
pipenv create from pipfile
Copy the code

Generate the requirements.txt file

pipenv lock -r [--dev] > requirements.txt
Copy the code

Install the module through the requirements.txt file

pipenv install -r requirements.txt
Copy the code

Pycharm referenced in the

Quick start learning materials

Pipenv Quick start