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.

Author Henning.von.Bargen
Recipients Andreas.Richter, Henning.von.Bargen, loewis, terry.reedy, zach.ware
Date 2014-09-15.14:34:38
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1410791679.36.0.572463367884.issue22139@psf.upfronthosting.co.za>
In-reply-to
Content
Perhaps this issue should be re-opened.

I stumbled across a similar issue today, and made some potentially useful observations.

On a machine with an existing c:\python27 directory (Python 2.7.5), I installed Python 2.7.8 with the "install just for me" option into a new directory c:\python278.

That's because there are several Python-based applications running; and I want to restrict the new Python version to one of them.

The application uses a different executable, LisaReportingAgent.exe.

Within the same environment (PATH first entry is c:\python278), calling python.exe, listing sys.path gives the expected output:

C:\Lisa\Kronos\reporting\test\bin>c:\python278\python
Python 2.7.8 (default, Jun 30 2014, 16:03:49) [MSC v.1500 32 bit (Intel)] on win
32
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> for f in sys.path: print f
... 

C:\Lisa\Kronos\reporting\test
c:\python278\python27.zip
c:\python278\DLLs
c:\python278\lib
c:\python278\lib\plat-win
c:\python278\lib\lib-tk
c:\python278
c:\python278\lib\site-packages
c:\python278\lib\site-packages\win32
c:\python278\lib\site-packages\win32\lib
c:\python278\lib\site-packages\Pythonwin
>>> ^Z

Whereas the special executable's output is much different:

C:\Lisa\Kronos\reporting\test\bin>..\..\bin\win32-x86\LisaReportingAgent.exe
Python 2.7.5 (default, May 15 2013, 22:43:36) [MSC v.1500 32 bit (Intel)] on win
32
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> for f in sys.path: print f
...

C:\Lisa\Kronos\reporting\test
C:\WINDOWS\system32\python27.zip
C:\Python278\Lib
C:\Python278\DLLs
C:\Python278\Lib\lib-tk
C:\Python27\Lib
C:\Python27\DLLs
C:\Python27\Lib\lib-tk
C:\Lisa\Kronos\reporting\test\bin
C:\Lisa\Kronos\reporting\bin\win32-x86
C:\Python27
C:\Python27\lib\site-packages
C:\Python27\lib\site-packages\win32
C:\Python27\lib\site-packages\win32\lib
C:\Python27\lib\site-packages\Pythonwin
>>>

Note the entries with c:\windows and with the different Python installation C:\python27. They are pointing to the old Python installation.

The executable is built from the following C code (except for initializing a SWIG-generated Python wrapper for a PDF library):

int main( int argc, char* argv[] ) {
	int rc = 0;

        /* ... setup a license key ... */

	Py_SetProgramName(argv[0]);
	Py_Initialize();
    
        /* ... init PDF library ... */

        rc = Py_Main(argc, argv);
	Py_Finalize();

	/* ... shut down PDF library ... */

	return rc;
}

I've read something that Python 2.7 behaves differently on Windows regarding installation and setup in comparison to 2.6. It seems that the new python.exe performs registry magic?
History
Date User Action Args
2014-09-15 14:34:39Henning.von.Bargensetrecipients: + Henning.von.Bargen, loewis, terry.reedy, zach.ware, Andreas.Richter
2014-09-15 14:34:39Henning.von.Bargensetmessageid: <1410791679.36.0.572463367884.issue22139@psf.upfronthosting.co.za>
2014-09-15 14:34:39Henning.von.Bargenlinkissue22139 messages
2014-09-15 14:34:38Henning.von.Bargencreate