![](/img/trans.png)
[英]How to install PyTorch with pipenv and save it to Pipfile and Pipfile.lock?
[英]How to remove a pipenv's PipFile, PipFile.lock and associated virtualenv?
要為 python 項目創建pipenv
,我首先創建了一個項目文件夾並進入該文件夾以指示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
模式下時在 Project 目錄中執行以下操作:
$ pipenv --rm
$ rm Pipfil*
這意味着我必須先刪除 Project 文件夾的虛擬環境,然后再刪除Pipfile
和Pipfile.lock
?
我們在這里:
# Removing venv directory ...
$ pipenv --rm
# ... and Pipfile, Pipfile.lock
$ rm Pipfile*
# Strange that deleted venv still activated, so exit from it.
$ exit
是的,這些是刪除pipenv
工件的正確說明。
要完全撤消您在示例中顯示的所有內容,您需要繼續執行以下操作:
$ cd ..
$ rm -rf Project
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.