Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to deactivate venv while using fish?

I have installed venv using python3 with fish like and activated using env/bin/activate.fish, but there is no deactivate.fish in env/bin/

➜ ls env/bin/
activate         activate.fish    easy_install     pip              pip3.7           python3
activate.csh     chardetect       easy_install-3.7 pip3             python           yapf

how can I deactivate venv?

like image 920
Dima Avatar asked Aug 22 '19 08:08

Dima


People also ask

How do I deactivate a VENV?

You can deactivate a virtual environment by typing “deactivate” in your shell. The exact mechanism is platform-specific and is an internal implementation detail (typically a script or shell function will be used).

What happens when you deactivate a VENV?

To deactivate: This exits the entire shell the venv is in, and drops you back to the original shell from before the activation script made any changes to the environment.


1 Answers

In opposite to activate, deactivate is implemented as a shell function, not as a shell script or binary in env/bin. You can verify that by running:

type -t deactivate 
function

To run the function and deactivate the virtualenv, just run deactivate

PS: This behaviour is the same for all shells, it is not special to fish.

like image 159
hek2mgl Avatar answered Sep 21 '22 17:09

hek2mgl