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

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.

主站蜘蛛池模板: 大庆市| 万全县| 红原县| 怀仁县| 海盐县| 罗江县| 仲巴县| 贡觉县| 晋宁县| 宜川县| 叙永县| 库伦旗| 措勤县| 大新县| 龙南县| 邳州市| 衡水市| 根河市| 西丰县| 镇平县| 尤溪县| 湖南省| 宜良县| 庆城县| 西充县| 信宜市| 安泽县| 肇州县| 揭阳市| 双牌县| 霍林郭勒市| 田林县| 益阳市| 汉阴县| 太和县| 工布江达县| 全椒县| 海口市| 堆龙德庆县| 淮安市| 安乡县|