I'm trying to deploy my web app on pythonanywhere and I need OpenCv with cotrib modules on it. So I compiled it using the following cmake config:
cmake -D CMAKE_BUILD_TYPE=RELEASE \
-D CMAKE_INSTALL_PREFIX=/usr/local \
-D WITH_CUDA=OFF \
-D INSTALL_PYTHON_EXAMPLES=ON \
-D OPENCV_EXTRA_MODULES_PATH=~/opencv/opencv_contrib/modules \
-D BUILD_EXAMPLES=ON \
-D BUILD_opencv_python3=yes ..
since I can't be root on pythonanywhere bash, I then installed OpenCv using DESTDIR
:
make install DESTDIR=/home/pathToInstallationDir...
No problems with installation, but python console could not yet import cv2
. Thanks to point 7 of this answere: Why cv2.so missing after opencv installed? I exported python path and it now tryes to import cv2
with following error log:
File "<stdin>", line 1, in <module>
File "/home/pathToInstallationDir.../usr/local/lib/python3.6/site-packages/cv2/__init__.py", line 96, in <module>
bootstrap()
File "/home/spir/pathToInstallationDir.../usr/local/lib/python3.6/site-packages/cv2/__init__.py", line 86, in bootstrap
import cv2
ImportError: libopencv_hdf.so.4.4: cannot open shared object file: No such file or directory
So I guess there is a enviroment variable specified in __init__.py
module that python interpreter follows to find all .so
in lib and it is the wrong one at the moment, cause i looked for libopencv_hdf.so.4.4
and is located in lib as it should be.
Am I correct? if yes, which variable is the incriminated one and how do i change it?
if not, what could be the right diagnosis for the problem?
please help.