gpt4 book ai didi

python - 如何删除 pipenv 的 PipFile、PipFile.lock 和关联的 virtualenv?

转载 作者:行者123 更新时间:2023-11-28 19:03:38 25 4
gpt4 key购买 nike

要为 python 项目创建一个 pipenv,我首先创建一个项目文件夹并进入该文件夹以指示 pipenv 创建 PipfilePipfile.lock 和关联的虚拟环境如下所示:

$ mkdir Project
$ cd Project
$ pipenv --three
Creating a virtualenv for this project…
Using /usr/bin/python3 (3.5.2) to create virtualenv…
⠋Already using interpreter /usr/bin/python3
Using base prefix '/usr'
New python executable in ~/.local/share/virtualenvs/Projects-jrsJaPdI/bin/python3
Also creating executable in ~/.local/share/virtualenvs/Projects-jrsJaPdI/bin/python
Installing setuptools, pip, wheel...done.

Virtualenv location: ~/.local/share/virtualenvs/Projects-jrsJaPdI
Creating a Pipfile for this project…
$
$ pipenv install --dev
Pipfile.lock not found, creating…
Locking [dev-packages] dependencies…
Locking [packages] dependencies…
Updated Pipfile.lock (711973)!
Installing dependencies from Pipfile.lock (711973)…
🐍 ▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉ 0/0 — 00:00:00
To activate this project's virtualenv, run the following:
$ pipenv shell

当不在 pipenv shell 模式下时,删除所有 pipenv 创建的内容的正确方法是在项目目录中执行以下操作:

$ pipenv --rm
$ rm Pipfil*

意思是我必须先删除项目文件夹的虚拟环境,然后再删除 PipfilePipfile.lock

最佳答案

我们在这里:

# Removing venv directory ...
$ pipenv --rm

# ... and Pipfile, Pipfile.lock
$ rm Pipfile*

# Strange that deleted venv still activated, so exit from it.
$ exit

关于python - 如何删除 pipenv 的 PipFile、PipFile.lock 和关联的 virtualenv?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49792994/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com