Skip to content
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

Symbol not found: _CGAffineTransformIdentity on MacOS 10.6 #1791

Merged
merged 1 commit into from Feb 27, 2013

Conversation

mdboom
Copy link
Member

@mdboom mdboom commented Feb 27, 2013

On MacOS 10.6, Matplotlib installs without error, but is then not importable:

Python 3.2.3 (default, Apr 13 2012, 00:15:25) 
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import matplotlib.pyplot as plt
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/tom/Library/Python/3.2/lib/python/site-packages/matplotlib-1.3.x-py3.2-macosx-10.6-x86_64.egg/matplotlib/pyplot.py", line 98, in <module>
    _backend_mod, new_figure_manager, draw_if_interactive, _show = pylab_setup()
  File "/Users/tom/Library/Python/3.2/lib/python/site-packages/matplotlib-1.3.x-py3.2-macosx-10.6-x86_64.egg/matplotlib/backends/__init__.py", line 25, in pylab_setup
    globals(),locals(),[backend_name])
  File "/Users/tom/Library/Python/3.2/lib/python/site-packages/matplotlib-1.3.x-py3.2-macosx-10.6-x86_64.egg/matplotlib/backends/backend_macosx.py", line 21, in <module>
    from matplotlib.backends import _macosx
ImportError: dlopen(/Users/tom/Library/Python/3.2/lib/python/site-packages/matplotlib-1.3.x-py3.2-macosx-10.6-x86_64.egg/matplotlib/backends/_macosx.so, 2): Symbol not found: _CGAffineTransformIdentity
  Referenced from: /Users/tom/Library/Python/3.2/lib/python/site-packages/matplotlib-1.3.x-py3.2-macosx-10.6-x86_64.egg/matplotlib/backends/_macosx.so
  Expected in: flat namespace
 in /Users/tom/Library/Python/3.2/lib/python/site-packages/matplotlib-1.3.x-py3.2-macosx-10.6-x86_64.egg/matplotlib/backends/_macosx.so

On Python 2.7, pyparsing doesn't even work:

>>> import matplotlib.pyplot as plt
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/tom/Library/Python/2.7/lib/python/site-packages/matplotlib-1.3.x-py2.7-macosx-10.6-x86_64.egg/matplotlib/__init__.py", line 113, in <module>
    import pyparsing
  File "/Users/tom/Library/Python/2.7/lib/python/site-packages/pyparsing-1.5.3-py2.7.egg/pyparsing.py", line 629
    nonlocal limit,foundArity
                 ^
SyntaxError: invalid syntax

but I'll report that to the pyparsing developers.

@astrofrog
Copy link
Contributor Author

Regarding the pyparsing bug, the reason it's using 1.5.3 is because 2.0.0 fails to install during the matplotlib install:

Processing pyparsing-2.0.0.zip
Writing /var/folders/8L/8L-R-5PbEh0ef6pKH-3E5k+++TI/-Tmp-/easy_install-VocUxa/pyparsing-2.0.0/setup.cfg
Running pyparsing-2.0.0/setup.py -q bdist_egg --dist-dir /var/folders/8L/8L-R-5PbEh0ef6pKH-3E5k+++TI/-Tmp-/easy_install-VocUxa/pyparsing-2.0.0/egg-dist-tmp-XdiKmp
SyntaxError: ('invalid syntax', ('build/bdist.macosx-10.6-x86_64/egg/pyparsing.py', 629, 22, '        nonlocal limit,foundArity\n'))

zip_safe flag not set; analyzing archive contents...
SyntaxError: ('invalid syntax', ('/Users/tom/Library/Python/2.7/lib/python/site-packages/pyparsing-1.5.3-py2.7.egg/pyparsing.py', 629, 22, '        nonlocal limit,foundArity\n'))

Adding pyparsing 1.5.3 to easy-install.pth file

Installed /Users/tom/Library/Python/2.7/lib/python/site-packages/pyparsing-1.5.3-py2.7.egg
error: Could not find required distribution pyparsing>=1.5.6

But in any case, that's a separate issue.

@pelson
Copy link
Member

pelson commented Feb 27, 2013

Thanks @astrofrog - I'm guessing this is new in the last day or so and this is a result of the change in #1454?

I don't think you're after a workaround, but if you were (or somebody else who finds this is) it is probably possible to change the backend in matplotlibrc and avoid this message.

@astrofrog
Copy link
Contributor Author

@pelson - thanks - just to confirm, I also see this on Python 2.

I opened a separate issue for the pyparsing issue (#1792).

@mdboom
Copy link
Member

mdboom commented Feb 27, 2013

Just a note to someone trying to track down this bug -- I would compare the compiler arguments when building the _macosx.so extension prior to commit 7940245 vs. now. Something is probably missing in the new version -- and the setup rework probably did not get enough mac testing. I might be able to get on a Mac later this afternoon...

@astrofrog
Copy link
Contributor Author

I can try and provide you with the compiler arguments - let me check.

@astrofrog
Copy link
Contributor Author

At 7940245 (after):

/usr/bin/g++-4.2 -bundle -undefined dynamic_lookup -L/opt/local/lib build/temp.macosx-10.6-x86_64-2.7/src/_macosx.o build/temp.macosx-10.6-x86_64-2.7/src/agg_py_transforms.o build/temp.macosx-10.6-x86_64-2.7/src/path_cleanup.o build/temp.macosx-10.6-x86_64-2.7/agg24/src/agg_bezier_arc.o build/temp.macosx-10.6-x86_64-2.7/agg24/src/agg_curves.o build/temp.macosx-10.6-x86_64-2.7/agg24/src/agg_image_filters.o build/temp.macosx-10.6-x86_64-2.7/agg24/src/agg_trans_affine.o build/temp.macosx-10.6-x86_64-2.7/agg24/src/agg_vcgen_contour.o build/temp.macosx-10.6-x86_64-2.7/agg24/src/agg_vcgen_dash.o build/temp.macosx-10.6-x86_64-2.7/agg24/src/agg_vcgen_stroke.o build/temp.macosx-10.6-x86_64-2.7/CXX/cxx_extensions.o build/temp.macosx-10.6-x86_64-2.7/CXX/cxxsupport.o build/temp.macosx-10.6-x86_64-2.7/CXX/IndirectPythonInterface.o build/temp.macosx-10.6-x86_64-2.7/CXX/cxxextensions.o -L/usr/local/lib -L/usr/lib -L/usr/X11/lib -L/opt/local/lib -lstdc++ -lm -o build/lib.macosx-10.6-x86_64-2.7/matplotlib/backends/_macosx.so

At 1cc6507 (before):

/usr/bin/g++-4.2 -bundle -undefined dynamic_lookup -L/opt/local/lib build/temp.macosx-10.6-x86_64-2.7/src/_macosx.o build/temp.macosx-10.6-x86_64-2.7/CXX/cxx_extensions.o build/temp.macosx-10.6-x86_64-2.7/CXX/cxxextensions.o build/temp.macosx-10.6-x86_64-2.7/CXX/cxxsupport.o build/temp.macosx-10.6-x86_64-2.7/CXX/IndirectPythonInterface.o build/temp.macosx-10.6-x86_64-2.7/src/agg_py_transforms.o build/temp.macosx-10.6-x86_64-2.7/src/path_cleanup.o -L/usr/local/lib -L/usr/lib -L/usr/X11/lib -L/opt/local/lib -lstdc++ -lm -o build/lib.macosx-10.6-x86_64-2.7/matplotlib/backends/_macosx.so -framework Cocoa

That's quite a big difference!

@astrofrog
Copy link
Contributor Author

It looks like

-framework Cocoa

is now missing - could it be that?

@mdboom
Copy link
Member

mdboom commented Feb 27, 2013

I think that's exactly it. Would you mind testing the attached patch?

@astrofrog
Copy link
Contributor Author

This fixes the issue - thanks!

By the way, any luck with getting Matplotlib on Shining Panda? I could set up a build on my local Jenkins Mac and publish to a remote Jenkins to catch this kind of issue early.

@mdboom
Copy link
Member

mdboom commented Feb 27, 2013

We're in the process of setting up the funding for Shining Panda for matplotlib. Stay tuned!

mdboom added a commit that referenced this pull request Feb 27, 2013
Symbol not found: _CGAffineTransformIdentity on MacOS 10.6
@mdboom mdboom merged commit 54b9e76 into matplotlib:master Feb 27, 2013
@mdboom mdboom deleted the fix-macosx-build branch August 7, 2014 13:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants