New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ImportError: libfontconfig.so.1: undefined symbol: FT_Done_MM_Var #12625
Comments
I tried again by destroying the "build" folder created for compilation, create the "build" folder again and do all the steps for compilation again. As before, I did not have an error while compiling, but I still have this error when trying to import cv2. The only difference was the fact that the flag "Non-free algorithms" remains "NO" this time even if some module of opencv-contrib where there in the section "To be built" (like xfeature2d, ximgproc, xphoto). I also installed other libraries that was missing to try to have all the opencv-contrib modules, but that did not change anything. My last compillation give me this:
|
After looking for a long time on different forums, I found several things like:
I end up giving up and simply use: pip install opencv-contrib-python It only takes 30.6 MB and 5 seconds to install it and it has everything I need, but without the relationships with the libraries installed only for OpenCV (like VTK, Tesseract, etc.). At least it works, not like with CMAKE where I try to find a solution, but nothing seems to be able to correct this problem. If anyone else has an idea to solve this problem, I'll try it to see if that fixes the problem. If no other solution can be found, this issue may be closed since another alternative has worked. |
Hi @PoissonChasseur, I also had the same problem. This error seems to persist even compiling OpenCv with different flags in cmake. Anyway, thanks for sharing the pip solution! It helped me a lot =) In addition that, if someone needs
As the solution this StackOverflow post suggest to install a different version: pip install opencv-python==3.4.2.16 opencv-contrib-python==3.4.2.16 |
I also got this problem, which was maybe caused by the dev version 4.0.0 of OpenCV which I built previously (no idea actually). To solve this, I deleted the mentioned lib :
And I also got the same problem with :
After removing those files and |
Thanks. I solved my problem after trying your method. Honestly, I don't uncertain that whether other problems will occur after deleting those files. |
I just run into the same issue on Ubuntu 18.04 with default installation of anaconda3. It looks like incompatible versions of fontconfig (2.13) and pango (1.42). Removing files mentioned above won't remove the packages from anaconda completely and it seems as way to hell (broken conda base environment). I would recommend installing correct versions as follows:
In my base environment it created unresolvable conflicts, but creating new environment with these versions works. So create environment as follows (use python version which you used for compilation):
Then copy
This will make OpenCV work right away. |
Uninstall fontconfig |
This answer works for me~ |
Hi @varunagrawal and others on this thread - same issue here , any non-hackish solutions ? Thanks |
@RohitDhankar not that I am aware of, sadly. The correct way would be to do an RCA and fix the underlying issue in OpenCV. |
As well, I had to remove this:
Then import cv2 works! |
System information (version)
Detailed description
After I install OpenCV with OpenCV-contrib from source, I got the following error when I try to import OpenCV:
I just finish the compilation without error using:
cmake -D CMAKE_BUILD_TYPE=RELEASE \ -D CMAKE_INSTALL_PREFIX=/usr/local \ -D INSTALL_PYTHON_EXAMPLES=ON \ -D INSTALL_C_EXAMPLES=ON \ -D WITH_CUDA=OFF \ -D ENABLE_FAST_MATH=1 \ -D CUDA_FAST_MATH=1 \ -D WITH_CUBLAS=1 \ -D BUILD_EXAMPLES=ON \ -D OPENCV_EXTRA_MODULES_PATH=../../opencv_contrib-3.4.3/modules ..
I first tried with CUDA, but because of errors in connection with the version of gcc (NVCC needs version <5, but OpenCV needs version> 7 because of the error "-Wimplicit-fallthrough = 3 "unrecognized at 2% compilation). I finally did the compilation without CUDA and I had no compilation error.
I find that other people who have errors like this have had it with Mathematica or Draftsight (for example). However, I do not know how to fix this in the case of OpenCV.
Note that I successfully compiled OpenCV (without CUDA and OpenCV_contrib) yesterday with the same compilation options.
For information, that was the information I get from cmake before compiling. We can see than "freetype2" was correctly identified (even if it seem that it could be the cause of the problem according to some forum of similar trouble on Mathematica)
The text was updated successfully, but these errors were encountered: