Eryk Sun added the comment:
Probably this is related to issue 25824. When built as a console application
and run from the command prompt, you should see an the error
ImportError: No module named site
If that's the case, the problem is that even the 64-bit build is incorrectly
setting the DLL version string to "2.7-32":
0:000> da poi(python27!PyWin_DLLVersionString)
00000000`50b878c0 "2.7-32"
So the interpreter is looking at the wrong registry key to get the default
sys.path:
python27!getpythonregpath+0x110:
00000000`509a3d90 ff15b2d20500 call qword ptr
[python27!_imp_RegOpenKeyExA (00000000`50a01048)]
ds:00000000`50a01048=
{ADVAPI32!RegOpenKeyExAStub (00007ffb`56f87d70)}
0:000> da @rdx
00000037`e4fd9940 "Software\Python\PythonCore\2.7-3"
00000037`e4fd9960 "2\PythonPath"
As a workaround, before calling Py_Initialize, add
Py_SetPythonHome("C:\\Python27"), or wherever you installed Python. Or create a
symbolic link to Python's Lib directory in the directory that has your
executable:
mklink /d Lib "C:\Python27\Lib"
Or 'fix' the "SOFTWARE\Python\PythonCore\2.7" registry key by renaming it to
"2.7-32". Or downgrade to 2.7.10 until 2.7.12 is released.
That said, probably you'll use a zipped library if distributing an application,
in which case this shouldn't be a problem.
----------
nosy: +eryksun
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue26108>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com