R
Railway14mo ago
Pada

I cannot use opencv2 and received ImportError: libgl.so.1 cannot open shared object file no such fil

Can anyone help me with that ??
Solution:
use the headless version of the opencv package
Jump to solution
31 Replies
Percy
Percy14mo ago
Project ID: 5a3e0b60-6df7-46d9-95dd-0dd4e2b53849
Pada
Pada14mo ago
5a3e0b60-6df7-46d9-95dd-0dd4e2b53849 project id
Pada
Pada14mo ago


Brody
Brody14mo ago
send your requirements.txt file please
Pada
Pada14mo ago
yes now aiohttp==3.8.5 aiosignal==1.3.1 async-timeout==4.0.2 attrs==23.1.0 blinker==1.6.2 camelot-py==0.11.0 certifi==2023.7.22 cffi==1.15.1 chardet==5.1.0 charset-normalizer==3.2.0 click==8.1.6 colorama==0.4.6 cryptography==41.0.2 distro==1.8.0 et-xmlfile==1.1.0 flask==2.3.3 Flask-Cors==4.0.0 frozenlist==1.4.0 ghostscript==0.7 greenlet==2.0.2 idna==3.4 importlib-metadata==6.8.0 itsdangerous==2.1.2 Jinja2==3.1.2 lxml==4.9.3 MarkupSafe==2.1.3 multidict==6.0.4 numpy==1.25.2 openai==0.27.8 opencv-python==4.8.0.74 openpyxl==3.1.2 pandas==2.0.3 pdfminer.six==20221105 pdftopng==0.2.3 Pillow==10.0.0 psycopg2==2.9.7 pycparser==2.21 pypdf==3.14.0 pypdf2==3.0.1 python-dateutil==2.8.2 python-docx==0.8.11 pytz==2023.3 requests==2.31.0 six==1.16.0 SQLAlchemy==2.0.20 tabula-py==2.7.0 tabulate==0.9.0 tqdm==4.65.0 typing-extensions==4.7.1 tzdata==2023.3 Unidecode==1.3.6 urllib3==2.0.4 werkzeug==2.3.7 yarl==1.9.2 zipp==3.16.2
Brody
Brody14mo ago
are you using all of those packages?
Pada
Pada14mo ago
most of is dependencys of others
Brody
Brody14mo ago
side note, please enclose all code / code-like text blocks in triple back ticks
Pada
Pada14mo ago
sorry, i don't understand, u need the code ?
Brody
Brody14mo ago
nevermind
aiohttp==3.8.5
aiosignal==1.3.1
async-timeout==4.0.2
attrs==23.1.0
blinker==1.6.2
camelot-py==0.11.0
certifi==2023.7.22
cffi==1.15.1
chardet==5.1.0
charset-normalizer==3.2.0
click==8.1.6
colorama==0.4.6
cryptography==41.0.2
distro==1.8.0
et-xmlfile==1.1.0
flask==2.3.3
Flask-Cors==4.0.0
frozenlist==1.4.0
ghostscript==0.7
greenlet==2.0.2
idna==3.4
importlib-metadata==6.8.0
itsdangerous==2.1.2
Jinja2==3.1.2
lxml==4.9.3
MarkupSafe==2.1.3
multidict==6.0.4
numpy==1.25.2
openai==0.27.8
opencv-python-headless==4.8.0.74
openpyxl==3.1.2
pandas==2.0.3
pdfminer.six==20221105
pdftopng==0.2.3
Pillow==10.0.0
psycopg2==2.9.7
pycparser==2.21
pypdf==3.14.0
pypdf2==3.0.1
python-dateutil==2.8.2
python-docx==0.8.11
pytz==2023.3
requests==2.31.0
six==1.16.0
SQLAlchemy==2.0.20
tabula-py==2.7.0
tabulate==0.9.0
tqdm==4.65.0
typing-extensions==4.7.1
tzdata==2023.3
Unidecode==1.3.6
urllib3==2.0.4
werkzeug==2.3.7
yarl==1.9.2
zipp==3.16.2
aiohttp==3.8.5
aiosignal==1.3.1
async-timeout==4.0.2
attrs==23.1.0
blinker==1.6.2
camelot-py==0.11.0
certifi==2023.7.22
cffi==1.15.1
chardet==5.1.0
charset-normalizer==3.2.0
click==8.1.6
colorama==0.4.6
cryptography==41.0.2
distro==1.8.0
et-xmlfile==1.1.0
flask==2.3.3
Flask-Cors==4.0.0
frozenlist==1.4.0
ghostscript==0.7
greenlet==2.0.2
idna==3.4
importlib-metadata==6.8.0
itsdangerous==2.1.2
Jinja2==3.1.2
lxml==4.9.3
MarkupSafe==2.1.3
multidict==6.0.4
numpy==1.25.2
openai==0.27.8
opencv-python-headless==4.8.0.74
openpyxl==3.1.2
pandas==2.0.3
pdfminer.six==20221105
pdftopng==0.2.3
Pillow==10.0.0
psycopg2==2.9.7
pycparser==2.21
pypdf==3.14.0
pypdf2==3.0.1
python-dateutil==2.8.2
python-docx==0.8.11
pytz==2023.3
requests==2.31.0
six==1.16.0
SQLAlchemy==2.0.20
tabula-py==2.7.0
tabulate==0.9.0
tqdm==4.65.0
typing-extensions==4.7.1
tzdata==2023.3
Unidecode==1.3.6
urllib3==2.0.4
werkzeug==2.3.7
yarl==1.9.2
zipp==3.16.2
replace your requirements.txt with this
Pada
Pada14mo ago
ah okay i will test oh men u save my work literally thank u so much
Brody
Brody14mo ago
no problem!
Pada
Pada14mo ago
[2023-08-25 15:20:17 +0000] [10] [INFO] Worker exiting (pid: 10)  [2023-08-25 15:20:18 +0000] [1] [INFO] Shutting down: Master  [2023-08-25 15:20:18 +0000] [1] [INFO] Reason: App failed to load.  [2023-08-25 15:20:21 +0000] [1] [INFO] Starting gunicorn 20.0.4  [2023-08-25 15:20:21 +0000] [1] [INFO] Listening at: http://0.0.0.0:6210 (1)  [2023-08-25 15:20:21 +0000] [1] [INFO] Using worker: sync  [2023-08-25 15:20:21 +0000] [10] [INFO] Booting worker with pid: 10  Failed to find attribute 'app' in 'main'. only code error now, but i solve thank u sooooooooo much ❤️
Brody
Brody14mo ago
do you have a main.py?
Pada
Pada14mo ago
yees
Brody
Brody14mo ago
flask?
Pada
Pada14mo ago
i think is this the error
Pada
Pada14mo ago
Pada
Pada14mo ago
Brody
Brody14mo ago
yeah move all that stuff outside of the main() function
Pada
Pada14mo ago
okaay
Brody
Brody14mo ago
and make sure you have this thing https://github.com/railwayapp-templates/flask/blob/main/main.py#L12-L13 that if statement is very important
Pada
Pada14mo ago
Pada
Pada14mo ago
i will modify for equal than your
Brody
Brody14mo ago
yeah make it look like the template
Pada
Pada14mo ago
yeeeeeeeeeeees 😄 this go up Ops, already did, thank u so much meen <3, i will apresentate this project today haha
Brody
Brody14mo ago
I will just mark as solved, this question was far too specific to your app to mark a solution
Pada
Pada14mo ago
A okaaay Thanks for all support.
Brody
Brody14mo ago
oh wait I can just do this
Solution
Brody
Brody14mo ago
use the headless version of the opencv package
Brody
Brody14mo ago
there we go, happy I could help
Want results from more Discord servers?
Add your server