[MacPorts] #69546: py312-matplotlib fails to install on eMac with Leopard 10.5.8 - all dependencies installed.

MacPorts noreply at macports.org
Sat Mar 23 23:47:51 UTC 2024


#69546: py312-matplotlib fails to install on eMac with Leopard 10.5.8 - all
dependencies installed.
----------------------------+------------------------
  Reporter:  ilovecrts      |      Owner:  reneeotten
      Type:  defect         |     Status:  closed
  Priority:  Normal         |  Milestone:
 Component:  ports          |    Version:  2.9.1
Resolution:  fixed          |   Keywords:
      Port:  py-matplotlib  |
----------------------------+------------------------

Comment (by ilovecrts):

 Hello Ken and Renee!

 Hooray! I was able to successfully build matplotlib on my eMac following
 your instructions! :) :) Thank you very, very much to the both of you! :)
 :)

 {{{
 XXXXX:~ YYYYY$ sudo port clean py312-matplotlib
 Password:
 --->  Cleaning py312-matplotlib
 XXXXX:~ YYYYY$ sudo port selfupdate
 --->  Updating MacPorts base sources using rsync
 MacPorts base version 2.9.1 installed,
 MacPorts base version 2.9.1 downloaded.
 --->  Updating the ports tree
 --->  MacPorts base is already the latest version

 The ports tree has been updated. To upgrade your installed ports, you
 should run
   port upgrade outdated
 XXXXX:~ YYYYY$ sudo port install py312-matplotlib
 Password:
 --->  Computing dependencies for py312-matplotlib
 --->  Fetching archive for py312-matplotlib
 --->  Attempting to fetch
 py312-matplotlib-3.5.3_1+cairo+webagg.darwin_9.ppc.tbz2 from
 http://mirror.fcix.net/macports/packages/py312-matplotlib
 --->  Attempting to fetch
 py312-matplotlib-3.5.3_1+cairo+webagg.darwin_9.ppc.tbz2 from
 http://packages.macports.org/py312-matplotlib
 --->  Attempting to fetch
 py312-matplotlib-3.5.3_1+cairo+webagg.darwin_9.ppc.tbz2 from
 http://kmq.jp.packages.macports.org/py312-matplotlib
 --->  Fetching distfiles for py312-matplotlib
 --->  Verifying checksums for py312-matplotlib
 --->  Extracting py312-matplotlib
 --->  Applying patches to py312-matplotlib
 --->  Configuring py312-matplotlib
 --->  Building py312-matplotlib
 --->  Staging py312-matplotlib into destroot
 --->  Installing py312-matplotlib @3.5.3_1+cairo+webagg
 --->  Activating py312-matplotlib @3.5.3_1+cairo+webagg
 --->  Cleaning py312-matplotlib
 --->  Updating database of binaries
 --->  Scanning binaries for linking errors
 --->  No broken files found.
 --->  No broken ports found.
 --->  Some of the ports you installed have notes:
   py312-matplotlib has the following notes:
     The default backend is the interactive Mac OS X backend. Different
 backends can be specified using the ~/.matplotlib/matplotlibrc file. More
 details regarding
     backends can be found in the matplotlib FAQ:

             https://matplotlib.org/stable/users/explain/backends.html
 XXXXX:~ YYYYY$
 }}}

 Unfortunately, I am running into a new problem. :(

 I want to test the matplotlib installation by making a very simple plot
 based on an example shown in the matplotlib tutorial documentation.

 https://matplotlib.org/stable/tutorials/pyplot.html

 {{{
 import matplotlib.pyplot as plt

 plt.plot([1, 2, 3, 4])
 plt.ylabel('some numbers')
 plt.show()
 }}}

 I get an error when I import matplotlib. :(

 {{{
 XXXXX:~ YYYYY$ python3
 Python 3.12.2 (main, Mar 13 2024, 18:40:15) [GCC 7.5.0] on darwin
 Type "help", "copyright", "credits" or "license" for more information.
 >>> import matplotlib.pyplot as plt
 Python(1098) malloc: *** error for object 0xa06da3dc: Non-aligned pointer
 being freed
 *** set a breakpoint in malloc_error_break to debug
 Python(1098) malloc: *** error for object 0xa06da36c: Non-aligned pointer
 being freed
 *** set a breakpoint in malloc_error_break to debug
 Matplotlib is building the font cache; this may take a moment.
 >>>
 }}}

 This behavior is repeatable except I get a different 4 digit number in the
 "Python(1098)" string.

 If I go further with the tutorial example I get the following error.

 {{{
 >>> plt.plot([1, 2, 3, 4])
 Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
   File
 "/opt/local/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12
 /site-packages/matplotlib/pyplot.py", line 2767, in plot
     return gca().plot(
            ^^^^^
   File
 "/opt/local/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12
 /site-packages/matplotlib/pyplot.py", line 2272, in gca
     return gcf().gca(**kwargs)
            ^^^^^
   File
 "/opt/local/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12
 /site-packages/matplotlib/pyplot.py", line 865, in gcf
     return figure()
            ^^^^^^^^
   File
 "/opt/local/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12
 /site-packages/matplotlib/pyplot.py", line 806, in figure
     manager = new_figure_manager(
               ^^^^^^^^^^^^^^^^^^^
   File
 "/opt/local/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12
 /site-packages/matplotlib/pyplot.py", line 324, in new_figure_manager
     _warn_if_gui_out_of_main_thread()
   File
 "/opt/local/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12
 /site-packages/matplotlib/pyplot.py", line 314, in
 _warn_if_gui_out_of_main_thread
     if (_get_required_interactive_framework(_get_backend_mod())
                                             ^^^^^^^^^^^^^^^^^^
   File
 "/opt/local/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12
 /site-packages/matplotlib/pyplot.py", line 217, in _get_backend_mod
     switch_backend(dict.__getitem__(rcParams, "backend"))
   File
 "/opt/local/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12
 /site-packages/matplotlib/pyplot.py", line 282, in switch_backend
     class backend_mod(matplotlib.backend_bases._Backend):
   File
 "/opt/local/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12
 /site-packages/matplotlib/pyplot.py", line 283, in backend_mod
     locals().update(vars(importlib.import_module(backend_name)))
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   File
 "/opt/local/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/importlib/__init__.py",
 line 90, in import_module
     return _bootstrap._gcd_import(name[level:], package, level)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
   File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
   File "<frozen importlib._bootstrap>", line 1331, in
 _find_and_load_unlocked
   File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
   File "<frozen importlib._bootstrap_external>", line 995, in exec_module
   File "<frozen importlib._bootstrap>", line 488, in
 _call_with_frames_removed
   File
 "/opt/local/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12
 /site-packages/matplotlib/backends/backend_macosx.py", line 4, in <module>
     from matplotlib.backends import _macosx
 ImportError: cannot import name '_macosx' from 'matplotlib.backends'
 (/opt/local/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12
 /site-packages/matplotlib/backends/__init__.py)
 >>>
 }}}

 Despite matplotlib building correctly, is there something else buggy under
 the hood or is there something wrong with my eMac? Should I open a new
 ticket here?

 Thank you both again - especially Ken! I really appreciate the time you
 are investing here. :)

-- 
Ticket URL: <https://trac.macports.org/ticket/69546#comment:12>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list