I am working on a python project and I am sadly experienced that once I attempt to run the script from the PyCharm ide I get the following error message:
from .cv2 import *
ImportError: libavcodec.so.57: cannot open shared object file: No such file or directory
Now running the same python script from terminal runs without any error so I feel pretty confident that every requirement is installed properly. Therefore I turned my attention to environment variables but I am not completely sure what should the name and value be of the variable I am supposed to add to pycharm environment variable list. I run the following command:
whereis libavcodec.so.57
and I got:
libavcodec.so: /usr/lib/x86_64-linux-gnu/libavcodec.so.57 /usr/lib/x86_64-linux-gnu/libavcodec.so
So I guess that has something to do with the the value of the env variable I am supposed to add to PyCharm.
Can anybody help me how to solve this?
This is because of the way you install the openCV.
Try the following command to install openCV correctly:
$ sudo apt-get remove python-opencv; sudo apt-get install python-opencv
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With