photoshop-python-api icon indicating copy to clipboard operation
photoshop-python-api copied to clipboard

comtypes TypeError: '_Dispatch' object is not callable

Open zimonitrome opened this issue 2 years ago • 4 comments

Describe the bug I get the following error when running the sample code:

Traceback (most recent call last):
  File "C:\photoshop_test.py", line 4, in <module>
    doc = app.documents.add()
  File "C:\Users\zimonitrome\anaconda3\envs\blender\lib\site-packages\photoshop\api\_documents.py", line 51, in add
    self.app.add(
TypeError: '_Dispatch' object is not callable

To Reproduce Steps to reproduce the behavior:

  1. create conda env with python 3.10 version
  2. pip install photoshop-python-api
  3. run script with sample code from readme.md

Expected behavior script to run without errors

Desktop (please complete the following information):

  • OS: Windows10
  • Photoshop Version: Photoshop v24.4.1 (Latest)
  • Python Version: python-3.10

zimonitrome avatar May 06 '23 23:05 zimonitrome

I also got the same error

rinlevan avatar May 10 '23 15:05 rinlevan

In my case, the first successful run script used in venv in admin mode (I run VSCode using administrator on Win11). And when I install other ps version and make script crash, I fix it use same way.

mianxiu avatar May 11 '23 16:05 mianxiu

Any news on this? Git the same error message with a fresh install (win10, latest Photoshop)

myUsernamesTaken avatar Jun 21 '23 11:06 myUsernamesTaken

IIRC I wasn't able to solve it. I tried other COM packages but Photoshop's COM is seemingly broken(?)

zimonitrome avatar Jun 21 '23 12:06 zimonitrome