You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
... whereas for HKCR\CLSID\{clsid}\InprocServer32 it is simply:
pythoncom38.dll
This is a problem for anaconda users who are encouraged not to register their python distribution on the PATH variable, and so need fully qualified paths or to activate their conda env/ use conda run to dynamically add references to the path. The InprocServer32 fails to load in 64-bit office hosts with conda for example.
Workaround
Easy workaround is use _reg_clsctx_ = comtypes.CLSCTX_LOCAL_SERVER to avoid creating an inproc server, meaning 64 bit apps default to the working outproc one.
Better workaround to get the InProc server working, I assume add some things to the PATH and avoid best conda practice - but I'm not sure what. Would you be able to point me in the right direction?
pythoncom38.dll has many hits on my computer in C:\WINDOWS\system32, C:\Users\...\anaconda3\Library\bin, C:\Users\...\anaconda3\pkgs\pywin32-227-py38he774522_1\Lib\site-packages\pywin32_system32 etc.
Best workaround, fully qualify pythoncom38.dll in the registry as well as any other files it depends on (e.g. python38.dll)
...or a combination of fully qualified registry entries and some judicious additions to PATH
Kind of a dupe of #1569 (comment) but that is a comment on a closed issue so may not be visible.
Expected behavior and actual behavior.
InProc Server registered from 64 bit python anaconda distribution should work in 64 bit COM client.
Version of Python and pywin32
Additional Context
So the registry key for
HKCR\CLSID\{clsid}\LocalServer32
is:... whereas for
HKCR\CLSID\{clsid}\InprocServer32
it is simply:This is a problem for anaconda users who are encouraged not to register their python distribution on the PATH variable, and so need fully qualified paths or to activate their conda env/ use
conda run
to dynamically add references to the path. TheInprocServer32
fails to load in 64-bit office hosts with conda for example.Workaround
_reg_clsctx_ = comtypes.CLSCTX_LOCAL_SERVER
to avoid creating an inproc server, meaning 64 bit apps default to the working outproc one.C:\WINDOWS\system32
,C:\Users\...\anaconda3\Library\bin
,C:\Users\...\anaconda3\pkgs\pywin32-227-py38he774522_1\Lib\site-packages\pywin32_system32
etc.pythoncom38.dll
in the registry as well as any other files it depends on (e.g.python38.dll
)See the excellent comments on this SO Question
PS Thank you so much for this library
The text was updated successfully, but these errors were encountered: