-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Building Matplotlib on Ubuntu #1874
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
Conversation
Although #1632 reported a problem with the freetype headers as well, I don't think these problems are related to this. |
The real question is why pkg-config isn't finding them. What does the output of |
Nono, pkg-config IS finding freetype2, but matplotlib restricts its search for |
Hmm, my setup is exactly the same and it works fine. Both on OS X and on Ubuntu. $ pkg-config freetype2 --cflags
-I/opt/local/include/freetype2 -I/opt/local/include All my freetype stuff is in |
Your setup seems to be far from being exactly the same. It appears that you manually installed freetype2, which ended up in
The One could either keep the system as it is and look for another freetype header that is located in |
@pwuertz: What's the exact error message you're getting? What the new setup code (in master) does is look in both the standard directories (as reported by Python) and what |
@pwuertz Aha, it only adds the extra flag for nondefault locations. I see now. Then yes, this is a problem. I see this behaviour on a separate machine where the package was installed into the default location. |
@mdboom How would one check the standard directories as reported by Python? For me, the 'obvious' places don't have the default In [2]: print sys.prefix
/opt/apps/ossw/applications/python/python-2.7.3/sl6
In [3]: print sys.path
['', '/opt/apps/ossw/applications/python/python-2.7.3/sl6/bin', '/h1/damon/python/lib/docopt-0.5.0-py2.7.egg', '/h1/damon', '/h1/damon/python/lib', '/opt/apps/ossw/applications/python/python-2.7.3/sl6/lib/python27.zip', '/opt/apps/ossw/applications/python/python-2.7.3/sl6/lib/python2.7', '/opt/apps/ossw/applications/python/python-2.7.3/sl6/lib/python2.7/plat-linux2', '/opt/apps/ossw/applications/python/python-2.7.3/sl6/lib/python2.7/lib-tk', '/opt/apps/ossw/applications/python/python-2.7.3/sl6/lib/python2.7/lib-old', '/opt/apps/ossw/applications/python/python-2.7.3/sl6/lib/python2.7/lib-dynload', '/opt/apps/ossw/applications/python/python-2.7.3/sl6/lib/python2.7/site-packages', '/opt/apps/ossw/applications/python/python-2.7.3/sl6/lib/python2.7/site-packages/gtk-2.0', '/opt/apps/ossw/applications/python/python-2.7.3/sl6/lib/python2.7/site-packages/IPython/extensions'] |
Sorry -- I was wrong -- it's not actually extracting the directories that distutils sends to the compiler by the default -- we're using a set of hardcoded paths in addition to what If you do
What do you get? |
In [1]: import setupext
In [2]: setupext.get_base_dirs()
Out[2]: ['/usr/local', '/usr']
In [3]: ext.include_dirs
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
<ipython-input-3-1bc9f4a4fcf1> in <module>()
----> 1 ext.include_dirs
NameError: name 'ext' is not defined
In [4]: setupext.include_dirs
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-4-fe5fcdb253e1> in <module>()
----> 1 setupext.include_dirs
AttributeError: 'module' object has no attribute 'include_dirs' |
Sorry... copy-and-paste error. I meant to say:
|
I think I tracked it down to
the |
In [1]: import setupext
In [2]: ext = setupext.make_extension("foo", [])
In [3]: ext.include_dirs
Out[3]: ['/usr/local/include', '/usr/include', '.'] |
Ah -- I see. At the very least, the example given in |
Huzzah! Thanks @mdboom. |
Self assigning. I hope to get a fix in later today. |
@@ -77,7 +77,7 @@ def check_output(*popenargs, **kwargs): | |||
pass | |||
|
|||
try: | |||
options['basedirlist'] = config.get("directories", "basedirlist") | |||
options['basedirlist'] = config.get("directories", "basedirlist").split(',') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to strip it? I'd have put something like /usr, /usr/local
(notice the space after the comma)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed. Stripping would be a good idea.
👍 LGTM |
@pwuertz: Once you've confirmed this fixes things for you, why don't you take the honors of pushing the big green button... |
fix reading basedirlist from setup.cfg
Confirmed, thanks @mdboom ! |
Hi,
I experienced a problem when compiling matplotlib on Ubuntu 13.04. The setup determined that the freetype2 headers are not installed (although they are). The reason for this is a function in setupext.py script that searches for "ft2build.h" in the freetype2 include directories ("/usr/include/freetype2" and below), whereas the file resides in "/usr/include/ft2build.h". As a quick workaround, I linked /usr/include/ft2build.h to /usr/include/freetype2/ft2build.h and matplotlib compiled just fine.
I don't know it this has been caused by a change in the ubuntu package or by a modification in setupext.py though..