Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Unable to import module: adobe in aws lambda

New Here ,
Dec 12, 2021 Dec 12, 2021

I have created a zip file by installing library in a folder bu using command

Pip install pdfservices-sdk -t .

 

And it was successful and i added a layer in aws lambda and tried running code but i think library is working with code.

 

Can anybody has solution to this?

 

653
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Dec 14, 2021 Dec 14, 2021

Can you share more information? In the post above you said you think the library is working, but I'm assuming you mean *not* working?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 14, 2021 Dec 14, 2021

Hi Raymond,

 

I have tried creating layer and the main code file in ec2 linux instance. Because i thought it might be due to OS dependencies, as lambda uses linux and i was using windows.

Now the code is runing but file is not being saved it shows error like,

 

Response
{
"errorMessage": "[Errno 18] Invalid cross-device link: '/tmp/extractSdkResult/b0ad3e245d6211eca02c3e63cbdf52ea.zip' -> '/var/task/ExtractTextInfoFromPDF.zip'",
"errorType": "OSError",
"stackTrace": [
" File \"/var/task/lambda_function.py\", line 40, in lambda_handler\n result.save_as(\"./ExtractTextInfoFromPDF.zip\")\n",
" File \"/opt/python/adobe/pdfservices/operation/internal/io/file_ref_impl.py\", line 45, in save_as\n os.rename(self._file_path, abs_path)\n"
]
}

 

It is not saving file.

I have tried shutil.copy() mtd instead of os.rename() in adobe library but still file is not getting saved

 

If you think i can use another mode  instead of using this line

# Execute the operation.
result: FileRef = extract_pdf_operation.execute(execution_context)

# Save the result to the specified location.(THIS ONE)
result.save_as("./ExtractTextInfoFromPDF.zip")

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 07, 2022 Feb 07, 2022
LATEST

Did anyone find the solution to this issue? I have the exact same problem

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources