Symbol not found

I finally somehow managed to get matplotlib to compile but now when I try to import matplotlib.pyplot I get the following error:

Traceback (most recent call last):
File “”, line 1, in
AttributeError: ‘module’ object has no attribute ‘pyplot’

from matplotlib import pyplot as plot
Traceback (most recent call last):
File “”, line 1, in
File “/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/matplotlib/pyplot.py”, line 6, in
from matplotlib.figure import Figure, figaspect
File “/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/matplotlib/figure.py”, line 18, in
from axes import Axes, SubplotBase, subplot_class_factory
File “/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/matplotlib/axes.py”, line 12, in
import matplotlib.axis as maxis
File “/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/matplotlib/axis.py”, line 10, in
import matplotlib.font_manager as font_manager
File “/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/matplotlib/font_manager.py”, line 52, in
from matplotlib import ft2font
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/matplotlib/ft2font.so, 2): Symbol not found: _FT_Attach_File
Referenced from: /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/matplotlib/ft2font.so
Expected in: dynamic lookup

What is going wrong here?

Thanks,

-Ranjit

Ranjit,

There are a couple of possibilities. The first is that the TrueType fonts packages weren’t detected during the build, so matplotlib compiled without it, leading to your issue. I have also seen an issue where your ~/.matplotlib/ needs to be cleaned out of font-related files. Another possibility has to do with building both numpy and matplotlib. I have found that if I update the numpy source code and rebuild it, then I have to rebuild matplotlib. Now that you managed to get a complete build. I would go back and completely eliminate the build directories of matplotlib (and numpy, if you have it), and rebuild. Build numpy first if you have that from source, and then build matplotlib.

So, first double-check your TrueType Font packages and see if you comply with the dependencies listed on the developer wiki. If so, then check your .matplotlib directory for any fontCache files and remove it. Lastly, do a complete clean and rebuild of matplotlib (the cleaning part is very important).

I hope that helps,
Ben Root

···

On Fri, Jun 25, 2010 at 11:56 AM, Ranjit Chacko <rjchacko@…287…> wrote:

I finally somehow managed to get matplotlib to compile but now when I try to import matplotlib.pyplot I get the following error:

Traceback (most recent call last):
File “”, line 1, in

AttributeError: ‘module’ object has no attribute ‘pyplot’

from matplotlib import pyplot as plot
Traceback (most recent call last):
File “”, line 1, in

File “/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/matplotlib/pyplot.py”, line 6, in
from matplotlib.figure import Figure, figaspect
File “/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/matplotlib/figure.py”, line 18, in

from axes import Axes, SubplotBase, subplot_class_factory

File “/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/matplotlib/axes.py”, line 12, in
import matplotlib.axis as maxis

File “/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/matplotlib/axis.py”, line 10, in
import matplotlib.font_manager as font_manager
File “/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/matplotlib/font_manager.py”, line 52, in

from matplotlib import ft2font

ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/matplotlib/ft2font.so, 2): Symbol not found: _FT_Attach_File
Referenced from: /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/matplotlib/ft2font.so

Expected in: dynamic lookup

What is going wrong here?

Thanks,

-Ranjit


ThinkGeek and WIRED’s GeekDad team up for the Ultimate

GeekDad Father’s Day Giveaway. ONE MASSIVE PRIZE to the

lucky parental unit. See the prize list and enter to win:

http://p.sf.net/sfu/thinkgeek-promo


Matplotlib-users mailing list

Matplotlib-users@lists.sourceforge.net

https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Hi Ben,

Thanks for the tips. How do I check the TrueType fonts? Googling matplotlib developer wiki doesn’t turn up anything. There isn’t anything in the ~/.matplotlib directory. I just went ahead and recompiled numpy and matplotlib, and got the same error.

-Ranjit

···

On Fri, Jun 25, 2010 at 12:59 PM, Benjamin Root <ben.root@…1304…> wrote:

Ranjit,

There are a couple of possibilities. The first is that the TrueType fonts packages weren’t detected during the build, so matplotlib compiled without it, leading to your issue. I have also seen an issue where your ~/.matplotlib/ needs to be cleaned out of font-related files. Another possibility has to do with building both numpy and matplotlib. I have found that if I update the numpy source code and rebuild it, then I have to rebuild matplotlib. Now that you managed to get a complete build. I would go back and completely eliminate the build directories of matplotlib (and numpy, if you have it), and rebuild. Build numpy first if you have that from source, and then build matplotlib.

So, first double-check your TrueType Font packages and see if you comply with the dependencies listed on the developer wiki. If so, then check your .matplotlib directory for any fontCache files and remove it. Lastly, do a complete clean and rebuild of matplotlib (the cleaning part is very important).

I hope that helps,
Ben Root

On Fri, Jun 25, 2010 at 11:56 AM, Ranjit Chacko <rjchacko@…287…> wrote:

I finally somehow managed to get matplotlib to compile but now when I try to import matplotlib.pyplot I get the following error:

Traceback (most recent call last):
File “”, line 1, in

AttributeError: ‘module’ object has no attribute ‘pyplot’

from matplotlib import pyplot as plot
Traceback (most recent call last):
File “”, line 1, in

File “/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/matplotlib/pyplot.py”, line 6, in
from matplotlib.figure import Figure, figaspect
File “/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/matplotlib/figure.py”, line 18, in

from axes import Axes, SubplotBase, subplot_class_factory

File “/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/matplotlib/axes.py”, line 12, in
import matplotlib.axis as maxis

File “/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/matplotlib/axis.py”, line 10, in
import matplotlib.font_manager as font_manager
File “/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/matplotlib/font_manager.py”, line 52, in

from matplotlib import ft2font

ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/matplotlib/ft2font.so, 2): Symbol not found: _FT_Attach_File
Referenced from: /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/matplotlib/ft2font.so

Expected in: dynamic lookup

What is going wrong here?

Thanks,

-Ranjit


ThinkGeek and WIRED’s GeekDad team up for the Ultimate

GeekDad Father’s Day Giveaway. ONE MASSIVE PRIZE to the

lucky parental unit. See the prize list and enter to win:

http://p.sf.net/sfu/thinkgeek-promo


Matplotlib-users mailing list

Matplotlib-users@lists.sourceforge.net

https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Sorry, it isn’t a developer wiki (numpy and scipy have that…). But here are the requirements to make sure that they are installed.

http://matplotlib.sourceforge.net/users/installing.html#build-requirements

Ben Root

···

On Fri, Jun 25, 2010 at 3:31 PM, Ranjit Chacko <rjchacko@…287…> wrote:

Hi Ben,

Thanks for the tips. How do I check the TrueType fonts? Googling matplotlib developer wiki doesn’t turn up anything. There isn’t anything in the ~/.matplotlib directory. I just went ahead and recompiled numpy and matplotlib, and got the same error.

-Ranjit

On Fri, Jun 25, 2010 at 12:59 PM, Benjamin Root <ben.root@…878…1304…> wrote:

Ranjit,

There are a couple of possibilities. The first is that the TrueType fonts packages weren’t detected during the build, so matplotlib compiled without it, leading to your issue. I have also seen an issue where your ~/.matplotlib/ needs to be cleaned out of font-related files. Another possibility has to do with building both numpy and matplotlib. I have found that if I update the numpy source code and rebuild it, then I have to rebuild matplotlib. Now that you managed to get a complete build. I would go back and completely eliminate the build directories of matplotlib (and numpy, if you have it), and rebuild. Build numpy first if you have that from source, and then build matplotlib.

So, first double-check your TrueType Font packages and see if you comply with the dependencies listed on the developer wiki. If so, then check your .matplotlib directory for any fontCache files and remove it. Lastly, do a complete clean and rebuild of matplotlib (the cleaning part is very important).

I hope that helps,
Ben Root

On Fri, Jun 25, 2010 at 11:56 AM, Ranjit Chacko <rjchacko@…287…> wrote:

I finally somehow managed to get matplotlib to compile but now when I try to import matplotlib.pyplot I get the following error:

Traceback (most recent call last):
File “”, line 1, in

AttributeError: ‘module’ object has no attribute ‘pyplot’

from matplotlib import pyplot as plot
Traceback (most recent call last):
File “”, line 1, in

File “/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/matplotlib/pyplot.py”, line 6, in
from matplotlib.figure import Figure, figaspect
File “/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/matplotlib/figure.py”, line 18, in

from axes import Axes, SubplotBase, subplot_class_factory

File “/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/matplotlib/axes.py”, line 12, in
import matplotlib.axis as maxis

File “/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/matplotlib/axis.py”, line 10, in
import matplotlib.font_manager as font_manager
File “/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/matplotlib/font_manager.py”, line 52, in

from matplotlib import ft2font

ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/matplotlib/ft2font.so, 2): Symbol not found: _FT_Attach_File
Referenced from: /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/matplotlib/ft2font.so

Expected in: dynamic lookup

What is going wrong here?

Thanks,

-Ranjit


ThinkGeek and WIRED’s GeekDad team up for the Ultimate

GeekDad Father’s Day Giveaway. ONE MASSIVE PRIZE to the

lucky parental unit. See the prize list and enter to win:

http://p.sf.net/sfu/thinkgeek-promo


Matplotlib-users mailing list

Matplotlib-users@lists.sourceforge.net

https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Oh, wait a minute, you are doing a Frameworks install on a Mac. I think there are others here that might be able to comment on Mac installs.

Ben

···

On Fri, Jun 25, 2010 at 3:31 PM, Ranjit Chacko <rjchacko@…287…> wrote:

Hi Ben,

Thanks for the tips. How do I check the TrueType fonts? Googling matplotlib developer wiki doesn’t turn up anything. There isn’t anything in the ~/.matplotlib directory. I just went ahead and recompiled numpy and matplotlib, and got the same error.

-Ranjit

On Fri, Jun 25, 2010 at 12:59 PM, Benjamin Root <ben.root@…878…1304…> wrote:

Ranjit,

There are a couple of possibilities. The first is that the TrueType fonts packages weren’t detected during the build, so matplotlib compiled without it, leading to your issue. I have also seen an issue where your ~/.matplotlib/ needs to be cleaned out of font-related files. Another possibility has to do with building both numpy and matplotlib. I have found that if I update the numpy source code and rebuild it, then I have to rebuild matplotlib. Now that you managed to get a complete build. I would go back and completely eliminate the build directories of matplotlib (and numpy, if you have it), and rebuild. Build numpy first if you have that from source, and then build matplotlib.

So, first double-check your TrueType Font packages and see if you comply with the dependencies listed on the developer wiki. If so, then check your .matplotlib directory for any fontCache files and remove it. Lastly, do a complete clean and rebuild of matplotlib (the cleaning part is very important).

I hope that helps,
Ben Root

On Fri, Jun 25, 2010 at 11:56 AM, Ranjit Chacko <rjchacko@…287…> wrote:

I finally somehow managed to get matplotlib to compile but now when I try to import matplotlib.pyplot I get the following error:

Traceback (most recent call last):
File “”, line 1, in

AttributeError: ‘module’ object has no attribute ‘pyplot’

from matplotlib import pyplot as plot
Traceback (most recent call last):
File “”, line 1, in

File “/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/matplotlib/pyplot.py”, line 6, in
from matplotlib.figure import Figure, figaspect
File “/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/matplotlib/figure.py”, line 18, in

from axes import Axes, SubplotBase, subplot_class_factory

File “/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/matplotlib/axes.py”, line 12, in
import matplotlib.axis as maxis

File “/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/matplotlib/axis.py”, line 10, in
import matplotlib.font_manager as font_manager
File “/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/matplotlib/font_manager.py”, line 52, in

from matplotlib import ft2font

ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/matplotlib/ft2font.so, 2): Symbol not found: _FT_Attach_File
Referenced from: /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/matplotlib/ft2font.so

Expected in: dynamic lookup

What is going wrong here?

Thanks,

-Ranjit


ThinkGeek and WIRED’s GeekDad team up for the Ultimate

GeekDad Father’s Day Giveaway. ONE MASSIVE PRIZE to the

lucky parental unit. See the prize list and enter to win:

http://p.sf.net/sfu/thinkgeek-promo


Matplotlib-users mailing list

Matplotlib-users@lists.sourceforge.net

https://lists.sourceforge.net/lists/listinfo/matplotlib-users

First, since you said you used pkg-config I would like to know what
libfreetype the ft2font.so lib is actually linked against. Can you
issue an otool -L ft2font.so in the matplotlib's directory? This will
tell you what libs are used.

I think most important is the compiler used, but since you are on 10.4
apparently, I don't know what the recent compiler for you is. Is it
gcc-4.0? (It seems to be.) Are there other gcc's around which could
have been used for the libfreetype2, or for Python itself? Can you
issue in a clean shell gcc --version, and it seems you used c++ as the
command for .cpp sources, right, so can you issue c++ --version too?

And what were your steps to get it build from the weird errors you
posted before (I didn't get a clue from them).

I don't know if I can help you but at least I can try to, right ....

Friedrich

2010/6/25 Ranjit Chacko <rjchacko@...287...>:

···

I finally somehow managed to get matplotlib to compile but now when I try to
import matplotlib.pyplot I get the following error:

ImportError:
dlopen(/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/matplotlib/ft2font.so,
2): Symbol not found: _FT_Attach_File
Referenced from:
/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/matplotlib/ft2font.so
Expected in: dynamic lookup