Python win32com - 安装了 32 位和 64 位版本的应用程序 [英] Python win32com - application installed with both 32bit and 64bit versions

查看:54
本文介绍了Python win32com - 安装了 32 位和 64 位版本的应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 python win32com 模块来自动化 Adob​​e Photoshop.这在某些机器上运行良好(在 Windows 帐户权限有限的用户上无法正常工作,但这是另一个问题).

但在安装了 32 位和 64 位版本 Photoshop 的机器上,我在尝试访问 com 对象时遇到错误,不是 Photoshop.Application 对象本身,而是 Photoshop.PhotoshopSaveOptions 和 Photoshop.SolidColor com 对象.

我得到的错误是服务器执行失败.

我猜 win32com 对 photoshop 的不同版本感到困惑.除了卸载一个版本,有没有办法指定 win32com 应该使用哪个版本?

谢谢

解决方案

我相信你必须拥有 32bit &64 位 python 安装了适当的 pywin32 版本(32 和 64).

对于 32 位 Photoshop,请在 32 位 Python 上运行您的脚本:

c:\python27\python myScript.py

对于 64 位,只需运行 64 位 Python:

c:\python27-64\python myScript.py

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

解决方案

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

这篇关于Python win32com - 安装了 32 位和 64 位版本的应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆