Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"examples._psd_files" not found #171

Closed
Penguin-Valkyrie opened this issue Jul 26, 2022 · 1 comment
Closed

"examples._psd_files" not found #171

Penguin-Valkyrie opened this issue Jul 26, 2022 · 1 comment

Comments

@Penguin-Valkyrie
Copy link

Penguin-Valkyrie commented Jul 26, 2022

Unable to "import examples._psd_files as psd"
I receive the exception: "No module named 'examples._psd_files"
The "examples" module is installed on my machine

Code(from "Exporting Layers as PNG"):
import os
from tempfile import mkdtemp

import examples._psd_files as psd

from photoshop import Session

PSD_FILE = psd.get_psd_files()

if name == "main":
psd_file = PSD_FILE["export_layers_as_png.png"]
with Session(psd_file, action="open", auto_close=True) as ps:
opts = ps.ExportOptionsSaveForWeb()

    png_file = os.path.join(mkdtemp(), "test.png")
    active_document = ps.app.activeDocument
    active_document.exportDocument(png_file, ps.ExportType.SaveForWeb, opts)
    os.startfile(png_file)

*My apologies for the initial misnaming and blank issue at first: this is my first time submitting an issue on Github. I also feel as though there is a simple step I missed somewhere along the way.

@Penguin-Valkyrie Penguin-Valkyrie changed the title mmmm "examples._psd_files" not found Jul 26, 2022
@loonghao
Copy link
Owner

Hi @Penguin-Valkyrie
Example files are not included if you installed via pip.

PSD files in here:
https://github.com/loonghao/photoshop-python-api/tree/main/examples/files

You can replace this path with the absolute path of the PSD

psd_file = PSD_FILE["export_layers_as_png.png"]

@loonghao loonghao closed this as completed Aug 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants