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

[BUG] PyTesseract Doesn't work with libpng15 #138

Open
TheLucasMoore opened this issue Jan 2, 2021 · 5 comments
Open

[BUG] PyTesseract Doesn't work with libpng15 #138

TheLucasMoore opened this issue Jan 2, 2021 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@TheLucasMoore
Copy link

TheLucasMoore commented Jan 2, 2021

Describe the bug
I've been using the pytesseract lambda image on top of aws-lambda-tesseract-layer. It does not work and I'm hoping to get clarification in the docs.

Screenshots
When running my function I see this error

{
  "errorMessage": "(127, 'tesseract: error while loading shared libraries: libpng15.so.15: cannot open shared object file: No such file or directory')",
  "errorType": "TesseractError",
  "stackTrace": [
    "  File \"/var/task/handler.py\", line 22, in translate\n    text = image_to_text(file_name)\n",
    ]
 }

It seems to imply that imports all succeeded and the tesseract binary is working. It breaks down when trying to run pytesseract though.

Layer Version ARN:
arn:aws:lambda:us-west-1:<my account>:layer:tesseract:7 (my own, following the tutorial in the README)
arn:aws:lambda:us-west-1:770693421928:layer:Klayers-python38-pytesseract:14

Framework:
Serverless

Additional context
It would be nice (and I'd be happy to help) to build a standard tesseract layer that plays nicely with the pytesseract layer.

@TheLucasMoore
Copy link
Author

Oh and I did go through #94 and comment there. At this point, I think this issue is distinct.

@TheLucasMoore
Copy link
Author

So I've got this working now. It was an issue with the Tesseract base image actually (see bweigel/aws-lambda-tesseract-layer#14).

Since everything else moved to Python 3.8, perhaps we can work together on getting a base image with the tesseract binary working in this repo?

@keithrozario
Copy link
Owner

I'm happy to include in the repo, if someone has a working binary layer already :)...

@TheLucasMoore
Copy link
Author

I do have one working! My fork is working for Python 3.8.
You just need to clone it and run:

# Build Layer components
./build.sh
# Deploy via Serverless
sls deploy

I don't have mine available in every availability zone like you do, so I think it'd be best if you still owned the layer though.
What do you think?

@keithrozario keithrozario added the bug Something isn't working label Feb 6, 2021
@rloibman
Copy link

rloibman commented Oct 3, 2022

Is there a Tesseract layer available for region sa-east-1? It could be python 3.8 or python 3.9... Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants