Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove a pipenv's PipFile, PipFile.lock and associated virtualenv?

Tags:

python

pipenv

To create a pipenv for a python project, I first created a project folder and go into the folder to instruct pipenv to create the Pipfile, Pipfile.lock and associated virtual environment like so:

$ 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

Is the proper way of removing all that pipenv had create simply doing the following in the Project directory when not in pipenv shell mode:

$ pipenv --rm
$ rm Pipfil*

Meaning I have to remove the Project folder's virtual environment first followed by removing the Pipfile and Pipfile.lock subsequently?

like image 959
Sun Bear Avatar asked Apr 12 '18 09:04

Sun Bear


People also ask

How do I remove all Pipenv environments?

Use pipenv --rm to remove the current virtual environment. Then use pipenv install --dev --pre to reinstall it fresh.

How do you remove Pipenv VENV?

To use pipenv to uninstall a package locally in a virtual environment created with venv or virtualenv: Open a command or terminal window (depending on the operating system) cd into the project directory. pipenv uninstall <packagename>

What is Pipfile and Pipfile lock?

The Pipfile. lock is intended to specify, based on the packages present in Pipfile, which specific version of those should be used, avoiding the risks of automatically upgrading packages that depend upon each other and breaking your project dependency tree. You can lock your currently installed packages using...

How do I make Pipenv ignore Virtualenvs 1?

You can set PIPENV_IGNORE_VIRTUALENVS=1 to force pipenv to ignore that environment and create its own instead. You can set PIPENV_VERBOSITY=-1 to suppress this warning. No virtualenv has been created for this project(/Library/Frameworks/Python. framework/Versions/3.7/lib/python3.


1 Answers

Here we are:

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

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

# Strange that deleted venv still activated, so exit from it.
$ exit
like image 154
rappongy Avatar answered Sep 21 '22 16:09

rappongy