Message180362
Python 3.3 includes PEP 397, a Python launcher for Windows, and PEP 405, virtual environment support in core. Unfortunately the Windows launcher does not respect virtual environments. Even with with a virtual environment activated and the current directory at the virtual environment's root, the Windows launcher will start python with the system environment, not the active virtual environment.
To demo:
Install python 3.3 for windows.
Create a virtual environment:
C:\>c:\Python33\Tools\Scripts\pyvenv.py c:\virtpy
Activate the virtual environment:
C:\>virtpy\Scripts\activate.bat
(virtpy) C:\>
Optionally cd to the virtual environment:
(virtpy) C:\>cd virtpy
(virtpy) C:\virtpy>
Start Python 3 with the new windows launcher:
(virtpy) C:\virtpy>py -3
Python 3.3.0 (v3.3.0:bd8afb90ebf2, Sep 29 2012, 10:55:48) [MSC v.1600 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>
Check sys.path
>>> import sys
>>>
>>> sys.path
['', 'C:\\Windows\\system32\\python33.zip', 'C:\\bin\\Python33\\DLLs', 'C:\\bin\\Python33\\lib', 'C:\\bin\\Python33', 'C:\\bin\\Python33\\lib\\site-packages']
>>>
The worst effect I've found is that installation of a package with windows launcher, "py -3 setup.py install", will ignore the active virtual environment and will change the system Python environment. That's bad because users frequently employ virtual environments to isolate changes that could damage a system configuration. |
|
Date |
User |
Action |
Args |
2013-01-21 23:57:37 | bryangeneolson | set | recipients:
+ bryangeneolson |
2013-01-21 23:57:37 | bryangeneolson | set | messageid: <1358812657.25.0.839528896034.issue17010@psf.upfronthosting.co.za> |
2013-01-21 23:57:37 | bryangeneolson | link | issue17010 messages |
2013-01-21 23:57:36 | bryangeneolson | create | |
|