官术网_书友最值得收藏!

Setting up a Python virtual environment with Pipenv

We will use a Python virtual environment to manage the packages for the projects in this book. A virtual environment is a Pythonic way to create a self-contained project directory tree that includes a particular combination of a Python version and packages that are specific to a project.

There are many benefits of using Python virtual environments:

  • Since all of the packages and dependencies of a project are specified in a configuration file, the project's development environment can be easily duplicated by other developers; this is very useful when you are working within a development team.
  • Even if you are working by yourself, having a virtual environment will help you with creating (and recreating) the environment on one or more computers for development, testing, and deployment.
  • A virtual environment also allows you to create separate Python environments, where parallel copies of Python dependencies can be installed. This way, we can keep conflicting Python versions and packages for different projects on the same computer.

Pipenv is the new kid on the block when it comes to Python virtual environments, but it has already been promoted as the officially recommended Python packaging tool from python.orgTo install pipenv, we will use Pip, the Python package management tool:

$ pip install pipenv
$ pipenv --version

This command will help you install and verify pipenv.

主站蜘蛛池模板: 株洲县| 彭州市| 禄丰县| 淮滨县| 图片| 阳江市| 遵义县| 仁化县| 普定县| 章丘市| 金门县| 新泰市| 哈密市| 开原市| 曲水县| 肇源县| 西华县| 井冈山市| 陵川县| 海阳市| 蛟河市| 墨江| 洛阳市| 海宁市| 金沙县| 内黄县| 遵义县| 眉山市| 申扎县| 恭城| 竹北市| 商水县| 珠海市| 玛沁县| 繁昌县| 涿州市| 兴化市| 桐庐县| 库尔勒市| 客服| 吴川市|