Opened 12 years ago

Closed 12 years ago

#19955 closed defect (invalid)

matplotlib-0.98.5.3 Configure error - Build fails when Tkinter missing

Reported by: hans.ekkehard.plesser@… Owned by: skymoo (Adam Mercer)
Priority: Normal Milestone:
Component: ports Version: 1.7.1
Keywords: Cc:
Port: py25-matplotlib

Description

I tried to install matplotlib issuing

sudo port install matplotlib

and ended up with the following error message

--->  Building py25-matplotlib
Error: Target org.macports.build returned: shell command " cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_python_py25-matplotlib/work/matplotlib-0.98.5.3" && /opt/local/bin/python2.5 setup.py --no-user-cfg build " returned error 1
Command output: ============================================================================
BUILDING MATPLOTLIB
            matplotlib: 0.98.5.3
                python: 2.5.4 (r254:67916, Mar 11 2009, 12:47:11)  [GCC
                        4.0.1 (Apple Inc. build 5490)]
              platform: darwin

REQUIRED DEPENDENCIES
                 numpy: 1.2.1
             freetype2: 9.19.3

OPTIONAL BACKEND DEPENDENCIES
                libpng: 1.2.35
               Tkinter: no
                        * TKAgg requires Tkinter
Traceback (most recent call last):
  File "setup.py", line 137, in <module>
    build_tkagg(ext_modules, packages)
  File "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_python_py25-matplotlib/work/matplotlib-0.98.5.3/setupext.py", line 1123, in build_tkagg
    add_tk_flags(module) # do this first
  File "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_python_py25-matplotlib/work/matplotlib-0.98.5.3/setupext.py", line 1041, in add_tk_flags
    module.libraries.extend(['tk' + tk_ver, 'tcl' + tk_ver])
UnboundLocalError: local variable 'tk_ver' referenced before assignment

The error did not disappear after installing py25-tkinter and tk. Installation worked when deactivating tkinter variant with -tkinter`.

Change History (7)

comment:1 Changed 12 years ago by mf2k (Frank Schima)

Owner: changed from macports-tickets@… to ram@…
Port: py25-matplotlib added; matplotlib removed

There is no "matplotlib" port. The first command returns an error for me. I assume you meant py25-matplotlib?

What is the result of the following?

port installed python25 python_select

and if installed:

python_select -s 

comment:2 Changed 12 years ago by skymoo (Adam Mercer)

py25-tkinter is now just a stub as tkinter is included in python25. What OS and architecture is this on? I can't reproduce this on Intel Leopard:

$ port installed python25 py25-tkinter py25-matplotlib
The following ports are currently installed:
  python25 @2.5.4_5+darwin_9+macosx (active)
$ sudo port install py25-matplotlib
--->  Fetching py25-matplotlib
--->  Verifying checksum(s) for py25-matplotlib
--->  Extracting py25-matplotlib
--->  Applying patches to py25-matplotlib
--->  Configuring py25-matplotlib
--->  Building py25-matplotlib
--->  Staging py25-matplotlib into destroot
--->  Installing py25-matplotlib @0.98.5.3_0+darwin_9+tkinter
--->  Activating py25-matplotlib @0.98.5.3_0+darwin_9+tkinter

The default backend is now the non-interactive Agg backend, different
backends can be specified using the ~/.matplotlib/matplotlibrc file.
More details, regarding backends, can be found in the matplotlib FAQ:

http://matplotlib.sourceforge.net/faq/installing_faq.html#what-is-a-backend

--->  Cleaning py25-matplotlib
$

Can you run

$ sudo port clean py25-matplotlib
$ sudo port -d install py25-matplotlib

and attach the output to this ticket?

comment:3 Changed 12 years ago by skymoo (Adam Mercer)

Status: newassigned

comment:4 Changed 12 years ago by blb@…

Make sure your python25 port is up to date (2.5.4_5 is current).

comment:5 in reply to:  1 Changed 12 years ago by hans.ekkehard.plesser@…

Replying to macsforever2000@…:

There is no "matplotlib" port. The first command returns an error for me. I assume you meant py25-matplotlib?

Apologies for my sloppiness. Yes, I meant py25-matplotlib.

What is the result of the following?

port installed python25 python_select
vpnans-68:~ plesser$ port installed python25 python_select
The following ports are currently installed:
  python25 @2.5.2_5+darwin_9
  python25 @2.5.4_0+darwin_9+macosx (active)
  python_select @0.2.1_0+darwin_9 (active)

and if installed:

python_select -s 
vpnans-68:~ plesser$ python_select -s
python25

comment:6 in reply to:  4 Changed 12 years ago by hans.ekkehard.plesser@…

Replying to blb@…:

Make sure your python25 port is up to date (2.5.4_5 is current).

After updating to python25 @2.5.4_5, everything works fine. So it seems my slightly outdated python25 @2.5.4_0 was the cause of the problem. But that was not easy to guess from the error message I got. Btw, my system is Leopard 10.5.7.

comment:7 Changed 12 years ago by skymoo (Adam Mercer)

Resolution: invalid
Status: assignedclosed
Note: See TracTickets for help on using tickets.