R
Railway15mo ago
Treffy

Pytesseract project setup: How do I get the package install location?

Hello, I'm struggling with making a discord bot using Pytesseract, I got it running but I don't know how to get the installation path of the tesseract to fix the message: /app/.apt/usr/bin/tesseract is not installed or it's not in your PATH. See README file for more information.. I read in an overflow question how to deploy using pytesseract but the instructions are from Heroku, the answer tells me to: - Add a build pack. ✅ https://discord.com/channels/713503345364697088/1139391639232712734 - Create an Aptfile. ✅ - Find the tessdata folder to set the variable. ❔ link: https://stackoverflow.com/a/56457594 What I've tried: - Run bash with railway. (only runs locally) - Tried to create a docker to see if I can get a path or some clue. Project ID: bf07da5c-d35e-4b6d-a262-c39207f4488c nixpacks.toml
[phases.setup]
nixPkgs = ["...", "tesseract"]
[phases.setup]
nixPkgs = ["...", "tesseract"]
Procfile
web: python main.py
web: python main.py
requirements.txt
discord.py==2.3.1
imutils==0.5.4
numpy
opencv-contrib-python-headless
pytesseract==0.3.10
python-dotenv==1.0.0
discord.py==2.3.1
imutils==0.5.4
numpy
opencv-contrib-python-headless
pytesseract==0.3.10
python-dotenv==1.0.0
Sorry if this question sounds stupid, I'm coming from front-end and I'm totally stupid with it. 😦
Stack Overflow
How to deploy pytesseract to Heroku
I have a Python app which words great via Localhost on my machine. I am trying to deploy it to Heroku. However it does not seem possible to accomplish this (I have spent approx 30 hours trying no...
Solution:
shouldn't pytesseract be able to find that out for itself? but you are giving it an incorrect path https://github.com/HenriqueFLTorres/Mir4Tools-Bot/blob/main/utils.py#L5...
Jump to solution
15 Replies
Percy
Percy15mo ago
Project ID: bf07da5c-d35e-4b6d-a262-c39207f4488c
Brody
Brody15mo ago
hey, is this still an issue?
Treffy
Treffy15mo ago
yes 😂 , I haven't tried anything new because I have no idea what to do
Brody
Brody15mo ago
can you share your repo please
Treffy
Treffy15mo ago
GitHub
GitHub - HenriqueFLTorres/Mir4Tools-Bot: A discord bot developed fo...
A discord bot developed for mir4 tools inventory matching and general assistance - GitHub - HenriqueFLTorres/Mir4Tools-Bot: A discord bot developed for mir4 tools inventory matching and general ass...
Brody
Brody15mo ago
quick question, what platform uses an Aptfile
Treffy
Treffy15mo ago
That's was an instruction given by the answers in the stack overflow question to deploy in heroku...
Brody
Brody15mo ago
@Vin I have no idea
MantisInABox
MantisInABox15mo ago
I’ve never used pytesseract honestly. Not even sure what it is
Brody
Brody15mo ago
Google is your friend OP
MantisInABox
MantisInABox15mo ago
I don’t google. I DuckIt But I’ll look into it when I’m not working
Treffy
Treffy15mo ago
@elberrd was also trying to deploy a project using pytesseract, but I didn't get a answers from him. Basically, I need to get a path of tessdata folder to work with pytesseract...
Solution
Brody
Brody15mo ago
shouldn't pytesseract be able to find that out for itself? but you are giving it an incorrect path https://github.com/HenriqueFLTorres/Mir4Tools-Bot/blob/main/utils.py#L5
Treffy
Treffy15mo ago
Sorry for being late. Surprisingly, that was the solution! Thank you! Different from the Heroku deploy instructions, pytesseract can run without any path given. So I even had to remove the environment variable TESSDATA_PREFIX.
Brody
Brody15mo ago
sounds good, glad you got it working
Want results from more Discord servers?
Add your server