Cannot run OpenCV from virtual environment: cannot find

asked 2017-06-09 12:05:03 -0500

I just finished installing OpenCV from source, and I can import cv2 fine in both Python 2 and Python 3 when I'm not in a virtual environment. However, as soon as I enter my virtual environment, I can no longer import cv2. I get the following error:

ImportError: cannot open shared object file: No such file or directory

I've looked it up online, and I see plenty of people having trouble loading libopencv_core, but not libopencv_freetype. I've looked for on my computer, and it's not there, so I'm not sure why it works outside of the virtual environment.

The syntax I used to create my virtual environment was virtualenv ~/.virtualenvs/facialrecog -p /usr/bin/python3.5 --system-site-packages.

Any suggestions would be greatly appreciated!

edit retag flag offensive close merge delete