Reputation: 3938
I am learning Python virtual environment. In one of my small projects I ran
pipenv run python myproject.py
and it created a virtualenv for me in C:\Users\USERNAME\.virtualenvs
I found it also created or modified some files under my project source code directory. I am just wondering how to cleanly delete this virtualenv and reverse my project back to a no-virtualenv state.
I am using python 3.6.4, and PyCharm.
Upvotes: 273
Views: 276967
Reputation: 2458
pipenv --venv
/Users/your_user_name/.local/share/virtualenvs/model-N-S4uBGU
C:\Users\your_user_name\.virtualenvs\model-N-S4uBGU
rm -rf /Users/your_user_name/.local/share/virtualenvs/model-N-S4uBGU
Remove-Item -Recurse -Force 'C:\Users\your_user_name\.virtualenvs\model-N-S4uBGU'
rmdir /s "C:\Users\your_user_name\.virtualenvs\model-N-S4uBGU"
Upvotes: 58
Reputation: 7355
You can run the pipenv
command with the --rm
option as in:
pipenv --rm
This will remove the virtualenv created for you under ~/.virtualenvs
See https://pipenv.kennethreitz.org/en/latest/cli/#cmdoption-pipenv-rm
Upvotes: 581