pywin32 build 219 has a problem in that it looks for the python 3.5 32 bit installation location in the wrong registry key. This problem is fixed in later pywin32 builds - 220 and 221 are the ones I tried - and they correctly find the python installation location in registry. You can see the pywin32 ticket here.
If you need build 219, then you can temporarily rename the registry entry.
I install python for all users on my PC, so the registry entries on my machine are in HKEY_LOCAL_MACHINE
. If you install python per user, the registry entries will be in HKEY_CURRENT_USER
. Also, my COM object is 32-bit, so we use the 32-bit python.
The 32-bit python registry entries will be located at: \SOFTWARE\Wow6432Node\Python\PythonCore
.
The 64-bit python registry entries will be located at:
\SOFTWARE\Python\PythonCore
.
In my case, I had two entries that needed to be temporarily renamed:
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Python\PythonCore\3.5
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Python\PythonCore\3.5-32
The Python installation location is found in the InstallPath
key, which on my machine is at:
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Python\PythonCore\3.5-32\InstallPath
My \PythonCore\3.5
folder only has the \Help\Pythonwin Reference
key, which is duplicated in the \PythonCore\3.5-32
folder, so I am thinking that this key is left over from some previous install and no longer relevant. However, I did not opt to delete it, and I temporarily renamed both as follows:
From:
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Python\PythonCore\3.5
To:
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Python\PythonCore\3.5-temp
From:
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Python\PythonCore\3.5-32
To:
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Python\PythonCore\3.5
Once the pywin32 build 219 install was complete, I restored the keys back to the original names.