question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

My code gives the error "Please check if you have Photoshop installed correctly."

See original GitHub issue

Hello, I’m trying to collect information from a user using telegram chat (pyTelegramBotAPI) so I can transfer this to photoshop inside the function in the future, but when I use the bot, the code gives the error “Please check if you have Photoshop installed correctly.” Although if you run the same, but not through the bot everything will run and work fine.

I tried - get a newer version of photoshop (CC2018 -> 2020), and also specify the path in the Windows environment variables. If you open photoshop using pyWin32 it works fine, but it’s very unprofitable for me, I was going to use only pythonPhotoshopAPI.

Here’s the function

def test_edit_text(info_from):
try:
    psApp = ps.Application()
    psApp.Open(r"mypath\first.psd")
    doc = psApp.Application.ActiveDocument
    print(info_from['test'])


    text_from_user = info_from['test'] 
    layer1init = doc.ArtLayers["layer1"]
    text_new_layer1 = layer1init.TextItem
    text_new_layer1 .contents = f"{text_from_user .upper()}"

    options = ps.JPEGSaveOptions(quality=5)
    jpg = r'mypath\photo.jpg'
    doc.saveAs(jpg, options, True)
except Exception as e:
    print(e)

If you run the function like this, nothing works

@bot.message_handler(content_types=['text'])
def func(message):
    if(message.text == '/ph'):    #Here we send a request to the function via telegram chat
        user_info = {'test' : 'asdsaasd'}
        test_edit_text(user_info) 

But if you run it like this, it works fine

if __name__ == '__main__':
     user_info = {'test' : 'asdsaasd'}
     test_edit_text(user_info) `

Why does the code suddenly stop seeing Photoshop? Is it possible that the two libraries are incompatible?

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
loonghaocommented, Jul 5, 2022

Hi @emogothyy We only have two places that have Please check if you have Photoshop installed correctly. https://github.com/loonghao/photoshop-python-api/blob/main/photoshop/api/_core.py#L43 https://github.com/loonghao/photoshop-python-api/blob/main/photoshop/api/_core.py#L97

This API then relies on having Photoshop installed locally, You can try to open Photoshop manually first, and then start your bot server to test.

If possible, please take a screenshot of your running process so that we can take a look

Why does the code suddenly stop seeing Photoshop? Is it possible that the two libraries are incompatible?

I checked that the dependencies between the two sides are not in conflict.

0reactions
emogothyycommented, Jul 8, 2022

I tried this method, but these places still have the same error, maybe the problem is in my photoshop, even after reinstalling, but if as before open with os or just open, everything works fine. Thanks so much for helping me with this error. Can I close the issue as solved?

image

Read more comments on GitHub >

github_iconTop Results From Across the Web

Installation error codes and solutions - Adobe Support
Find information on deployment error codes, exit codes, and error messages that appear in Photoshop Elements and Premiere Elements ...
Read more >
Fix download, install, or update errors for your Adobe apps
Quickly find solutions to common download, install, or update errors. Type the error number or title below to find your error and see...
Read more >
Some items could not be insalled successfully?
Solved: A couple of days ago I purchased Photoshop Elements 2018 and attempted to install it on my Windows 10 Pro build 16299...
Read more >
Solved: Error code 50 - Adobe Support Community - 5956026
I tryed installing via compatibility win xp sp3 and got another strange error massage, that something is missing and i should redownload the...
Read more >
Troubleshoot installation | Photoshop Elements, Premiere ...
Installation issues can be caused by many factors, including conflicting startup items, incorrect data in the Windows registry, and hardware ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found