Python win32com - application installed with both 32bit and 64bit versions

心已入冬 提交于 2021-01-28 03:24:26

问题


I am using pythons win32com module to automate Adobe Photoshop. This works fine on some machines (have had issues with it not working on users with limited windows account permissions, but thats another issue).

But on machines with both the 32bit and 64bit versions of Photoshop installed, I am getting errors when trying to access com objects, not the Photoshop.Application object itself, but Photoshop.PhotoshopSaveOptions, and Photoshop.SolidColor com objects.

The error I get is Server Execution failed.

I guess win32com is getting confused with the different versions of photoshop. Aside from uninstalling one version, is there a way to specify which version win32com should be using?

Thanks


回答1:


I am sure you have to have 32bit & 64bit python installed with appropriate pywin32 versions (32 & 64).

for 32bit Photoshop, run your script on 32 bit Python:

c:\python27\python myScript.py

for 64bit, just run 64bit Python:

c:\python27-64\python myScript.py


来源:https://stackoverflow.com/questions/3937060/python-win32com-application-installed-with-both-32bit-and-64bit-versions

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!