Use Pipenv create a virtual environment

Pipenv pip is based on the Python package management tool, it appears to solve the drawbacks of the old pip + vitualenv + requirements.txt way of working. Specifically, it is a pip, Pipfile and Virtualenv combination, with which you can achieve efficient Python project development.
First, install Pipenv
use pip install Pipenv
sudo pip install pipenv
use the following command to check whether Pipenv installed
pipenv --version

Second, create a virtual environment
first make sure that the current working directory in the root directory of the program project, and then use the pipenv install command to create the current project virtual environment:
<ignore_js_op>
(virtual environment named "the current project directory name + a bunch of random characters")

and then use the pipenv shell command to explicitly activate the virtual environment:
<ignore_js_op>

when you need to exit, use the exit command to exit the virtual environment

Third, managing dependencies
in a virtual environment created in the installation Python packages
pipenv install the package name
(you can use pipenv graph command to view dependent situation under the current environment, or use pip list to view the list of dependencies in a virtual environment.)

when you need a new when the environment to run the program, only you need to perform pipenv install command. Pipenv will create a new virtual environment, and automatically read from the dependent pipfile and mounted to the newly created virtual environment.

Use pipenv update package name can be updated dependent version.

More technical information may concern: gzitcast

Guess you like

Origin www.cnblogs.com/heimaguangzhou/p/11635127.html