目录
2 Configure pipenv for an existing Python project
3 Create an environment using the Pipfile
Configure projects in PyCharm | Configure a Python interpreter | Configure a pipenv environment |
在PyCharm中配置项目 | 配置Python解释器 | 配置pipenv环境 |
Pipenv is a tool that provides all necessary means to create a virtual environment for your Python project.
It automatically manages project packages through the Pipfile file as you install or uninstall packages.
Pipenv是一个工具,它提供了为Python项目创建虚拟环境的所有必要手段。
在您安装或卸载软件包时,它会通过Pipfile文件自动管理项目软件包。
Pipenv also generates the Pipfile.lock file, which is used to produce deterministic builds and create a snapshot of your working environment.
This might be particularly helpful for security sensitive deployment, when project requirements and packages versions are critical.
For more information about pipenv, refer to the project documentation at pipenv.pypa.io.
Pipenv还生成Pipfile.lock文件,该文件用于生成确定性构建并创建工作环境的快照。
当项目需求和包版本很关键时,这对于安全敏感的部署可能特别有用。
有关pipenv的更多信息,请参阅pipenv.pypa.io上的项目文档。
To use pipenv with PyCharm, you need to implement several preparation steps.
要在PyCharm中使用pipenv,您需要执行几个准备步骤。
1 Install pipenv
1 安装pipenv
-
Run the following command to ensure you have pip installed in your system:
运行以下命令以确保系统中安装了pip:$ pip --version
You should expect to receive a system response indicating the pip version. If no pip is discovered, install it as described in the Installation Instructions. Alternatively, you can download and install Python from http://python.org.
您应该期望收到一个系统响应,指示pip版本。如果没有发现pip,请按照安装说明中的说明进行安装。或者,您可以从http://python.org下载并安装Pytho