7

pipenv为 python 项目创建一个,我首先创建了一个项目文件夹并进入该文件夹以指示pipenv创建Pipfile,Pipfile.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在不处于pipenv shell模式时,只需在项目目录中执行以下操作即可删除所有创建的正确方法:

$ pipenv --rm
$ rm Pipfil*

意思是我必须先删除 Project 文件夹的虚拟环境,然后再删除PipfileandPipfile.lock随后?

4

2 回答 2

5

我们到了:

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

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

# Strange that deleted venv still activated, so exit from it.
$ exit
于 2020-05-15T08:41:32.330 回答
-16

是的,这些是删除pipenv工件的正确说明。

要完全撤消您在示例中显示的所有内容,您需要继续:

$ cd ..
$ rm -rf Project
于 2018-04-18T22:10:46.593 回答