This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Title: can not deactivate venv (deactivate.bat) if the venv was activated by activate.ps1.
Type: behavior Stage: resolved
Components: Windows Versions: Python 3.5
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: Giga Image, paul.moore, steve.dower, tim.golden, vinay.sajip, zach.ware
Priority: normal Keywords:

Created on 2016-04-08 19:01 by Giga Image, last changed 2022-04-11 14:58 by admin. This issue is now closed.

File name Uploaded Description Edit
one.JPG Giga Image, 2016-04-08 19:01
Messages (2)
msg263036 - (view) Author: Giga Image (Giga Image) Date: 2016-04-08 19:01
Win10/Python 3.5.1

If virtual environment was activated using powershell script, it can not deactivate the environment using only provided deactivate.bat.

Pre-condition : Virtual environment already in place.

1. Open elevated Powershell (Administrator access).

2. Activate virtual environment using activate.ps1 (must).

3  Deactivate the environment in powershell using deactivate.bat (since there is no deactivate.ps1).

Observation : Virtual environment never exit.
Expected: deactivate script should be working as expected (as the script name suggests).

NOTE: See attached screenshot.
msg263039 - (view) Author: Zachary Ware (zach.ware) * (Python committer) Date: 2016-04-08 19:21
Activate.ps1 creates a 'deactivate' function, just like activate.*sh on UNIX.  deactivate.bat is an implementation detail, because Windows cmd does not support functions.  In any activated venv on any platform, simply doing `deactivate` should work to deactivate the venv.
Date User Action Args
2022-04-11 14:58:29adminsetgithub: 70902
2016-04-08 19:21:13zach.waresetstatus: open -> closed

nosy: + vinay.sajip
messages: + msg263039

resolution: not a bug
stage: resolved
2016-04-08 19:01:10Giga Imagecreate