-
-
Notifications
You must be signed in to change notification settings - Fork 30.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
venv: Deactivate.ps1 is not created when Activate.ps1 was used #77091
Comments
There was a related issue, which was closed https://bugs.python.org/issue26715. If virtual environment was activated using Powershell script - Activate.ps1, the Deactivate.ps1 was not created, while the documentation says that it should. "You can deactivate a virtual environment by typing “deactivate” in your shell. The exact mechanism is platform-specific: for example, the Bash activation script defines a “deactivate” function, whereas on Windows there are separate scripts called deactivate.bat and Deactivate.ps1 which are installed when the virtual environment is created." Way to reproduce under Windows 10, Python 3.6.4
Also, when the environment was activated with Activate.ps1, |
Sorry, |
As noted in the related issue that you link to, there is not meant to be a deactivate.ps1 script - the deactivate command is provided via a global deactivate function created when you run activate.ps1 (although this is an implementation detail, all that matters is that a "deactivate" command exists, not how it is implemented). The documentation of the implementation-specific behaviour is incorrect, but as it's describing internal implementation details, it shouldn't be relied on anyway. Suggested documentation fix: """ |
As noted in the related issue that you link to, there is not meant to be a deactivate.ps1 script - the deactivate command is provided via a global deactivate function created when you run activate.ps1 (although this is an implementation detail, all that matters is that a "deactivate" command exists, not how it is implemented). The documentation of the implementation-specific behaviour is incorrect, but as it's describing internal implementation details, it shouldn't be relied on anyway. Suggested documentation fix: """ |
Yes, I agree, I did not understand the documentation correctly. It seems to me that the problem in the perception arose because of the fact that "deactivate" is not formatted as shell command, while Also, it is not mentioned in the documentation that it is possible to activate environment in Powershell with "Drive:\> <venv>\Scripts\activate", but maybe it's not always true and I have nowhere to check. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: