When activating an venv environment, the command "deactivate" is only available in the current instance of the shell and not in a shellscript (a shellscript is always executed in sub-shell (separate instance)) or any subshel
Environment
Provide at least:
OS: macOS Big Sur 11.7.10 (20G1427)
Using bash version "3.2.57(1)-release" from Homebrew
pip list of the host python where virtualenv is installed:
$ pip list
Package Version
---------- -------
pip 23.2.1
setuptools 56.0.0
Output of the virtual environment creation
Make sure to run the creation with -vvv --with-traceback:
That will still keep the activation in the first shell as it's not possible to change parent shell envs, so this would cause more confusion than benefit.
Issue
When activating an venv environment, the command "deactivate" is only available in the current instance of the shell and not in a shellscript (a shellscript is always executed in sub-shell (separate instance)) or any subshel
Environment
Provide at least:
pip list
of the host python wherevirtualenv
is installed:Output of the virtual environment creation
Make sure to run the creation with
-vvv --with-traceback
:-> see attached console-output.txt
Steps to reproduce:
Suggested solution: Add/bin/activate
export -f deactivate
to