问题
Hello I seem to be having trouble importing opencv on my deployed flask app on Heroku!
I've referred to similar posts such as this this "ImportError: libSM.so.6: cannot open shared object file: No such file or directory " but can't seem to figure out the next steps on windows.
This is what I've done so far:
1. gone to Heroku -> App -> Settings -> Buildpacks -> added Python buildpack
2. Added a Aptfile.txt to my directory with the following packages on each line (read this somewhere not sure if it makes any sense)
libsm6 , libxrender1 ,libfontconfig1, libice6
Notes:
- My openCV version-- opencv-python==3.4.3.18
- I'm on windows so the sudo commands recommended in the other post answers dont work
Thanks in advance!
回答1:
Use opencv-python-headless it's out of libSM6 dependency.
pip install opencv-python-headless
回答2:
put this line in requirments.txt
opencv-python-headless==4.2.0.32
来源:https://stackoverflow.com/questions/53110120/use-opencv-on-deployed-flask-app-heroku