loonghao / photoshop-python-api

Python API for Photoshop.
https://loonghao.github.io/photoshop-python-api/
MIT License
604 stars 68 forks source link

comtypes TypeError: '_Dispatch' object is not callable #247

Open zimonitrome opened 1 year ago

zimonitrome commented 1 year ago

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):

rinleit commented 1 year ago

I also got the same error

mianxiu commented 1 year ago

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.

myUsernamesTaken commented 1 year ago

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

zimonitrome commented 1 year ago

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