Message358017
When you activate a venv on Windows and use a shebang with a major verion qualifier, the python launcer does not properly detect that a venv is active and uses the system installation instead.
The incorrect behavior is documented in this SO question where another user has confirmed and suggested it is a bug: https://stackoverflow.com/questions/59238326
Steps to reproduce (needs script.py attached below):
1. Install Python 3.7 on Windows 10 (64 bit)
2. Run script.py you should see:
PS C:\pytest> .\script.py
EXECUTABLE: C:\Program Files\Python37\python.exe
PREFIX: C:\Program Files\Python37
BASE PREFIX: C:\Program Files\Python37
3. Create and activate a virtual environment with:
PS C:\pytest> python -m venv .venv
PS C:\pytest> . .\.venv\Scripts\Activate.ps1
4. Run script.py you should see it ignore the active virtual environment:
(.venv) PS C:\pytest> .\script.py
EXECUTABLE: C:\Program Files\Python37\python.exe
PREFIX: C:\Program Files\Python37
BASE PREFIX: C:\Program Files\Python37
I am using Windows 10 64-bit, update 1903 and Python 3.7.5-64 |
|
Date |
User |
Action |
Args |
2019-12-08 18:49:03 | Alexandros Karypidis | set | recipients:
+ Alexandros Karypidis, paul.moore, tim.golden, zach.ware, steve.dower |
2019-12-08 18:49:03 | Alexandros Karypidis | set | messageid: <1575830943.65.0.538772164668.issue38999@roundup.psfhosted.org> |
2019-12-08 18:49:03 | Alexandros Karypidis | link | issue38999 messages |
2019-12-08 18:49:03 | Alexandros Karypidis | create | |
|