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:46:12
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1410792372.51.0.5095407708.issue22139@psf.upfronthosting.co.za>
In-reply-to
Content
The online help says: 

"""
When Python is hosted in another .exe (different directory, embedded via COM, etc), the “Python Home” will not be deduced, so the core path from the registry is used. Other “application paths” in the registry are always read.
"""

and

"""
If the environment variable PYTHONHOME is set, it is assumed as “Python Home”. Otherwise, the path of the main Python executable is used to locate a “landmark file” (Lib\os.py) to deduce the “Python Home”. If a Python home is found, the relevant sub-directories added to sys.path (Lib, plat-win, etc) are based on that folder. Otherwise, the core Python path is constructed from the PythonPath stored in the registry.
"""

So I set PYTHONHOME=c:\python278, then call LisaReportingServer.exe again. Now the output for sys.path looks OK to me, but "import hmac" still fails:

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\DLLs
c:\python278\lib
c:\python278\lib\plat-win
c:\python278\lib\lib-tk
C:\Lisa\Kronos\reporting\bin\win32-x86
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
>>> import hmac
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "c:\python278\lib\hmac.py", line 8, in <module>
    from operator import _compare_digest as compare_digest
ImportError: cannot import name _compare_digest
>>>
History
Date User Action Args
2014-09-15 14:46:12Henning.von.Bargensetrecipients: + Henning.von.Bargen, loewis, terry.reedy, zach.ware, Andreas.Richter
2014-09-15 14:46:12Henning.von.Bargensetmessageid: <1410792372.51.0.5095407708.issue22139@psf.upfronthosting.co.za>
2014-09-15 14:46:12Henning.von.Bargenlinkissue22139 messages
2014-09-15 14:46:12Henning.von.Bargencreate