You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: python3.7/site-packages/matplotlib/ft2font.so: Undefined symbol "FT_Done_Glyph" #21202
What you mind "crossed up install"?
Before report issue I deleted from venv v3.5.0b1, v3.4.3 and install v3.4.2
On each of version import matplotlib give this error.
>>> import matplotlib
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/venv/lib/python3.7/site-packages/matplotlib/__init__.py", line 157, in <module>
_check_versions()
File "/venv/lib/python3.7/site-packages/matplotlib/__init__.py", line 142, in _check_versions
from . import ft2font
ImportError: /venv/lib/python3.7/site-packages/matplotlib/ft2font.so: Undefined symbol "FT_Done_Glyph"
>>>
I do not think that this is a OS/platform issue (I fully expect Matplotlib to work on freeBSD given that https://www.freshports.org/math/py-matplotlib/ exists), but rather a local installation issue.
How did you install Matplotlib and which freetype so is the linker finding at run time? From the error I believe that you built Matplotlib with one version of freetype, but are finding a different one at run time.
To debug this we will need to know how you installed Matplotlib (did you get a wheel or build it locally?), what compiler you are using (from conversation in gitter I think you are using llvm?), did you use the system freetype? How did you make your virtual env? Without this information (and without access to a freeBSD system set up exactly as your is), the best we can do is guess.
Matplotlib was installed by pip and whole process was done in this way, this same other versions.
LLVM was a second "shoot" when try compile other libs, but on standard was this same problem.
Venv was made by virtualenv
did you use the system freetype?
Not sure about this question. What you mind? I'm not touching this in other way than simple usage of import matplotlib.
pip install matplotlib
Defaulting to user installation because normal site-packages is not writeable
Collecting matplotlib
Downloading matplotlib-3.3.4.tar.gz (37.9 MB)
|################################| 37.9 MB 8.5 MB/s
Collecting cycler>=0.10
Downloading cycler-0.10.0-py2.py3-none-any.whl (6.5 kB)
Collecting kiwisolver>=1.0.1
Using cached kiwisolver-1.3.1.tar.gz (53 kB)
Requirement already satisfied: numpy>=1.15 in /usr/local/lib/python3.6/site-packages (from matplotlib) (1.16.6)
Requirement already satisfied: pillow>=6.2.0 in /usr/local/lib/python3.6/site-packages (from matplotlib) (7.0.0)
Requirement already satisfied: pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.3 in /usr/local/lib/python3.6/site-packages (from matplotlib) (2.4.7)
Requirement already satisfied: python-dateutil>=2.1 in /usr/local/lib/python3.6/site-packages (from matplotlib) (2.8.1)
Requirement already satisfied: six in /usr/local/lib/python3.6/site-packages (from cycler>=0.10->matplotlib) (1.15.0)
Building wheels for collected packages: matplotlib, kiwisolver
Building wheel for matplotlib (setup.py) ... done
Created wheel for matplotlib: filename=matplotlib-3.3.4-cp36-cp36m-freebsd_12_2_RELEASE_p2_amd64.whl
Python 3.6.12 (default, Oct 29 2020, 17:30:47)
[GCC FreeBSD Clang 10.0.1 (git@github.com:llvm/llvm-project.git llvmorg-10.0.1- on freebsd12
Type "help", "copyright", "credits" or "license" for more information.
>>> import matplotlib
Traceback (most recent call last):
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/user/.local/lib/python3.6/site-packages/matplotlib/__init__.py", line 174, in <module>
_check_versions()
File "/home/user/.local/lib/python3.6/site-packages/matplotlib/__init__.py", line 159, in _check_versions
from . import ft2font
So you are building from source (rather than grabbing a wheel). Something is clearly going wrong with the linking, but without a freebsd system I can not debug further. I suggest looking at the MAKEFILE in the port to see what they are doing.
It might be helpful to post the output of pip install -v matplotlib.
pip --version
pip 21.2.4 from /lib/python3.7/site-packages/pip (python 3.7)
How is possible that pip is for python2 when python38?
Anyway I try.. and no effect, this same.
After install on python27 matplotlib-2.2.5.tar.gz for test, working. Also no relation with problems around ft2font.so?
GCC FreeBSD Clang 10.0.1 (git@github.com:llvm/llvm-project.git llvmorg-10.0.1- on freebsd12
Type "help", "copyright", "credits" or "license" for more information.
>>> import matplotlib
>>> matplotlib.__version__
'2.2.5'
>>>
FreeBSD 12 ships with Python 3.8, so I'm not sure where you got 3.6 or 3.7 from. And pip install matplotlib compiles with builtin FreeType and loads fine. It also compiles and loads fine if you use system FreeType.
I don't know where you got this wheel from:
Using cached wheel link: file:///usr/home/userman/.cache/pip/wheels/09/f4/84/841a4c463638ce3204dcb7137673efe82f22fba82544946b1f/matplotlib-3.3.4-cp36-cp36m-freebsd_12_2_RELEASE_p2_amd64.whl
but you should delete all the matplotlib wheels you have and build again cleanly.
You have gcc installed, and the FreeType configure finds that instead of clang which is being used by Python, and something gets broken with mixed compilers (probably LTO). You can work around that by exporting CC=clang CXX=clang++ before installing.
Activity
ManPython commentedon Sep 27, 2021
import matplotlib matplotlib.__version__For this code this same
python3.7/site-packages/matplotlib/ft2font.so: Undefined symbol "FT_Done_Glyph"
jklymak commentedon Sep 28, 2021
You have a crossed up install, and probably need to try again. I strongly recommend conda.
ManPython commentedon Sep 28, 2021
What you mind "crossed up install"?
Before report issue I deleted from venv v3.5.0b1, v3.4.3 and install v3.4.2
On each of version import matplotlib give this error.
I uninstall again, and no changes.
freetype-config --version
23.4.17
ManPython commentedon Sep 28, 2021
I recommending do test on freebsd12 if can do somebody to confirm that working.
tacaswell commentedon Sep 28, 2021
I do not think that this is a OS/platform issue (I fully expect Matplotlib to work on freeBSD given that https://www.freshports.org/math/py-matplotlib/ exists), but rather a local installation issue.
How did you install Matplotlib and which freetype so is the linker finding at run time? From the error I believe that you built Matplotlib with one version of freetype, but are finding a different one at run time.
To debug this we will need to know how you installed Matplotlib (did you get a wheel or build it locally?), what compiler you are using (from conversation in gitter I think you are using llvm?), did you use the system freetype? How did you make your virtual env? Without this information (and without access to a freeBSD system set up exactly as your is), the best we can do is guess.
ManPython commentedon Sep 28, 2021
Matplotlib was installed by pip and whole process was done in this way, this same other versions.
LLVM was a second "shoot" when try compile other libs, but on standard was this same problem.
Venv was made by virtualenv
Not sure about this question. What you mind? I'm not touching this in other way than simple usage of import matplotlib.
ManPython commentedon Sep 28, 2021
I try without venv and this same.
ManPython commentedon Sep 28, 2021
Looks was this type issue related to compiler
#14684
tacaswell commentedon Sep 28, 2021
So you are building from source (rather than grabbing a wheel). Something is clearly going wrong with the linking, but without a freebsd system I can not debug further. I suggest looking at the MAKEFILE in the port to see what they are doing.
It might be helpful to post the output of
pip install -v matplotlib.ManPython commentedon Sep 28, 2021
after pip install -v matplotlib.
..part of long log
3 remaining items
ManPython commentedon Sep 29, 2021
pip --version
pip 21.2.4 from /lib/python3.7/site-packages/pip (python 3.7)
How is possible that pip is for python2 when python38?
Anyway I try.. and no effect, this same.
After install on python27 matplotlib-2.2.5.tar.gz for test, working. Also no relation with problems around ft2font.so?
QuLogic commentedon Sep 30, 2021
FreeBSD 12 ships with Python 3.8, so I'm not sure where you got 3.6 or 3.7 from. And
pip install matplotlibcompiles with builtin FreeType and loads fine. It also compiles and loads fine if you use system FreeType.I don't know where you got this wheel from:
but you should delete all the matplotlib wheels you have and build again cleanly.
ManPython commentedon Oct 1, 2021
Well.. after delete cache etc. now this type line not exist.. but it was just cache..
In any cases problem still exist.
Here is new log.
matplotlib_log2.txt
QuLogic commentedon Oct 1, 2021
You have gcc installed, and the FreeType configure finds that instead of clang which is being used by Python, and something gets broken with mixed compilers (probably LTO). You can work around that by exporting
CC=clang CXX=clang++before installing.Ensure internal FreeType uses same compiler as Python
ManPython commentedon Oct 6, 2021
@QuLogic I can confirm that working now. Some requiments for kiwisolver is needed only. Thx.
tacaswell commentedon Oct 7, 2021
Thank you for reporting this @ManPython !
Ensure internal FreeType uses same compiler as Python
Ensure internal FreeType uses same compiler as Python