Fixed this using the suggestion from Robert Kern<br><span style="visibility: visible;" id="main"><span style="visibility: visible;" id="search"><h3 class="r"><a href="http://www.google.com/url?sa=t&source=web&ct=res&cd=1&url=http%3A%2F%2Fwww.nabble.com%2FIs-this-a-bug-in-numpy.distutils---td24800016.html&ei=uvyFSrDWMoOqtgP8xfmtBw&rct=j&q=UnboundLocalError%3A+local+variable+%27build_clib%27+referenced+before+assignment&usg=AFQjCNGNoj-K8Ao4dGQ6tacrZ2nejs7h1g" class="l" onmousedown="return rwt(this,'','','res','1','AFQjCNGNoj-K8Ao4dGQ6tacrZ2nejs7h1g','')">Nabble - Numpy-discussion - Is this a bug in numpy.distutils ?</a></h3>
</span></span><span>On Tue, Aug 4, 2009 at 15:09, Matthew Brett<</span><a href="http://www.nabble.com/user/SendEmail.jtp?type=post&post=24815598&i=0" target="_top" rel="nofollow"><span>matthew.brett@...</span></a><span>> wrote:
</span><br><br><span>>  File "/home/mb312/usr/<b class="highlight">local</b>/lib/python2.5/site-packages/numpy/distutils/command/build_ext.py",
</span><br><span>> line 74, in run
</span><br><span>>    self.library_dirs.append(<b class="highlight">build_clib</b>.<b class="highlight">build_clib</b>)
</span><br><span>> <b class="highlight">UnboundLocalError</b>: <b class="highlight">local</b> <b class="highlight">variable</b> '<b class="highlight">build_clib</b>' <b class="highlight">referenced</b> <b class="highlight">before</b> <b class="highlight">assignment</b>
</span><br><span>>
</span><br><span>> because of the check for inplace builds above that, leaving <b class="highlight">build_clib</b>
</span><br><span>> undefined.  I'm afraid I wasn't quite sure what the right thing to do
</span><br><span>> was.
</span><br><br><span>Probably just
</span><br><br><span>  <b class="highlight">build_clib</b> = self.distribution.get_command_obj('<b class="highlight">build_clib</b>')
</span><br><br><span>after the log.warn().
<br><br><br>This worked indeed.<br><br>Thanks :)<br></span><span style="visibility: visible;" id="main"><span style="visibility: visible;" id="search"><br></span></span><br><br><div class="gmail_quote">On Fri, Aug 14, 2009 at 4:11 PM, Gökhan Sever <span dir="ltr"><<a href="mailto:gokhansever@gmail.com">gokhansever@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hello,<br><br>I fix the scipy installation issue. I usually checkout the whole ETS trunk (ets co ETS) and do a "ets develop". After fullfilling the requirements it was always successfully building the whole code-stack (well at least always in Fedora 10). In this case it fails on Enable compilation step. <br>

<br>Don't know this error: "build_clib already run, it is too late to ensure in-place build of build_clib" is due to my system files or a conflict with the installed Python tools.<br><br>One more thing to note; there is build_clib.py file under /usr/lib/python2.6/distutils/command. Might these be due to a conflict between numpy's directive and Python's distutil?<div>
<div></div><div class="h5"><br>
<br><div class="gmail_quote">On Thu, Aug 13, 2009 at 5:36 PM, Gökhan Sever <span dir="ltr"><<a href="mailto:gokhansever@gmail.com" target="_blank">gokhansever@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

For some unknown reason, ets develop can't pass the following compilation point:<br>
<br>
<br>
g++: enthought/kiva/agg/src/kiva_rect.cpp<br>
ar: adding 8 object files to build/temp.linux-i686-2.6/libkiva_src.a<br>
running build_ext<br>
build_clib already run, it is too late to ensure in-place build of build_clib<br>
Traceback (most recent call last):<br>
  File "setup.py", line 327, in <module><br>
    **config<br>
  File "/home/gsever/Desktop/python-repo/numpy/numpy/distutils/core.py",<br>
line 186, in setup<br>
    return old_setup(**new_attr)<br>
  File "/usr/lib/python2.6/distutils/core.py", line 152, in setup<br>
    dist.run_commands()<br>
  File "/usr/lib/python2.6/distutils/dist.py", line 975, in run_commands<br>
    self.run_command(cmd)<br>
  File "/usr/lib/python2.6/distutils/dist.py", line 995, in run_command<br>
    cmd_obj.run()<br>
  File "/home/gsever/Desktop/python-repo/numpy/numpy/distutils/command/build_ext.py",<br>
line 74, in run<br>
    self.library_dirs.append(build_clib.build_clib)<br>
UnboundLocalError: local variable 'build_clib' referenced before assignment<br>
Traceback (most recent call last):<br>
  File "/usr/bin/ets", line 8, in <module><br>
    load_entry_point('ETSProjectTools==0.6.0.dev-r24434',<br>
'console_scripts', 'ets')()<br>
  File "/usr/lib/python2.6/site-packages/ETSProjectTools-0.5.1-py2.6.egg/enthought/ets/ets.py",<br>
line 152, in main<br>
    args.func(args, cfg)<br>
  File "/usr/lib/python2.6/site-packages/ETSProjectTools-0.5.1-py2.6.egg/enthought/ets/develop.py",<br>
line 76, in main<br>
    checkouts.perform(command, dry_run=args.dry_run)<br>
  File "/usr/lib/python2.6/site-packages/ETSProjectTools-0.5.1-py2.6.egg/enthought/ets/tools/checkouts.py",<br>
line 126, in perform<br>
    '%s' % project)<br>
RuntimeError: Unable to complete command for project:<br>
/home/gsever/Desktop/python-repo/ETS_3.3.1/Enable_3.2.1<br>
<br>
<br>
Any suggestions?<br>
<br>
<br>
<br>
##################################################################<br>
[gsever@ccn Desktop]$ python -c 'from numpy.f2py.diagnose import run; run()'<br>
##################################################################<br>
------<br>
<a href="http://os.name" target="_blank">os.name</a>='posix'<br>
------<br>
sys.platform='linux2'<br>
------<br>
sys.version:<br>
2.6 (r26:66714, Jun  8 2009, 16:07:26)<br>
[GCC 4.4.0 20090506 (Red Hat 4.4.0-4)]<br>
------<br>
sys.prefix:<br>
/usr<br>
------<br>
sys.path=':/usr/lib/python2.6/site-packages/foolscap-0.4.2-py2.6.egg:/usr/lib/python2.6/site-packages/Twisted-8.2.0-py2.6-linux-i686.egg:/home/gsever/Desktop/python-repo/ipython:/home/gsever/Desktop/python-repo/numpy:/home/gsever/Desktop/python-repo/matplotlib/lib:/usr/lib/python2.6/site-packages/Sphinx-0.6.2-py2.6.egg:/usr/lib/python2.6/site-packages/docutils-0.5-py2.6.egg:/usr/lib/python2.6/site-packages/Jinja2-2.1.1-py2.6-linux-i686.egg:/usr/lib/python2.6/site-packages/Pygments-1.0-py2.6.egg:/usr/lib/python2.6/site-packages/xlwt-0.7.2-py2.6.egg:/usr/lib/python2.6/site-packages/spyder-1.0.0beta1-py2.6.egg:/usr/lib/python2.6/site-packages/PyOpenGL-3.0.0c1-py2.6.egg:/home/gsever/Desktop/python-repo/ETS_3.3.1/EnthoughtBase_3.0.4:/home/gsever/Desktop/python-repo/ETS_3.3.1/TraitsBackendWX_3.2.1:/home/gsever/Desktop/python-repo/ETS_3.3.1/ETSProjectTools_0.6.0:/home/gsever/Desktop/python-repo/ETS_3.3.1/Chaco_3.2.1:/home/gsever/Desktop/python-repo/ETS_3.3.1/ETS_3.3.1:/home/gsever/Desktop/python-repo/ETS_3.3.1/TraitsGUI_3.1.1:/home/gsever/Desktop/python-repo/ETS_3.3.1/Traits_3.2.1:/home/gsever/Desktop/python-repo/ETS_3.3.1/BlockCanvas_3.1.1:/usr/lib/python26.zip:/usr/lib/python2.6:/usr/lib/python2.6/plat-linux2:/usr/lib/python2.6/lib-tk:/usr/lib/python2.6/lib-old:/usr/lib/python2.6/lib-dynload:/usr/lib/python2.6/site-packages:/usr/lib/python2.6/site-packages/Numeric:/usr/lib/python2.6/site-packages/PIL:/usr/lib/python2.6/site-packages/gst-0.10:/usr/lib/python2.6/site-packages/gtk-2.0:/usr/lib/python2.6/site-packages:/usr/lib/python2.6/site-packages/wx-2.8-gtk2-unicode'<br>


------<br>
Failed to import numarray: No module named numarray<br>
Found Numeric version '24.2' in<br>
/usr/lib/python2.6/site-packages/Numeric/Numeric.pyc<br>
Found new numpy version '1.4.0.dev' in<br>
/home/gsever/Desktop/python-repo/numpy/numpy/__init__.pyc<br>
Found f2py2e version '2' in<br>
/home/gsever/Desktop/python-repo/numpy/numpy/f2py/f2py2e.pyc<br>
Found numpy.distutils version '0.4.0' in<br>
'/home/gsever/Desktop/python-repo/numpy/numpy/distutils/__init__.pyc'<br>
------<br>
Importing numpy.distutils.fcompiler ... ok<br>
------<br>
Checking availability of supported Fortran compilers:<br>
GnuFCompiler instance properties:<br>
  archiver        = ['/usr/bin/g77', '-cr']<br>
  compile_switch  = '-c'<br>
  compiler_f77    = ['/usr/bin/g77', '-g', '-Wall', '-fno-second-<br>
                    underscore', '-fPIC', '-O3', '-funroll-loops']<br>
  compiler_f90    = None<br>
  compiler_fix    = None<br>
  libraries       = ['g2c']<br>
  library_dirs    = []<br>
  linker_exe      = ['/usr/bin/g77', '-g', '-Wall', '-g', '-Wall']<br>
  linker_so       = ['/usr/bin/g77', '-g', '-Wall', '-g', '-Wall', '-<br>
                    shared']<br>
  object_switch   = '-o '<br>
  ranlib          = ['/usr/bin/g77']<br>
  version         = LooseVersion ('3.4.6')<br>
  version_cmd     = ['/usr/bin/g77', '--version']<br>
Gnu95FCompiler instance properties:<br>
  archiver        = ['/usr/bin/gfortran', '-cr']<br>
  compile_switch  = '-c'<br>
  compiler_f77    = ['/usr/bin/gfortran', '-Wall', '-ffixed-form', '-fno-<br>
                    second-underscore', '-fPIC', '-O3', '-funroll-loops']<br>
  compiler_f90    = ['/usr/bin/gfortran', '-Wall', '-fno-second-underscore',<br>
                    '-fPIC', '-O3', '-funroll-loops']<br>
  compiler_fix    = ['/usr/bin/gfortran', '-Wall', '-ffixed-form', '-fno-<br>
                    second-underscore', '-Wall', '-fno-second-underscore', '-<br>
                    fPIC', '-O3', '-funroll-loops']<br>
  libraries       = ['gfortran']<br>
  library_dirs    = []<br>
  linker_exe      = ['/usr/bin/gfortran', '-Wall', '-Wall']<br>
  linker_so       = ['/usr/bin/gfortran', '-Wall', '-Wall', '-shared']<br>
  object_switch   = '-o '<br>
  ranlib          = ['/usr/bin/gfortran']<br>
  version         = LooseVersion ('4.4.0')<br>
  version_cmd     = ['/usr/bin/gfortran', '--version']<br>
Fortran compilers found:<br>
  --fcompiler=gnu    GNU Fortran 77 compiler (3.4.6)<br>
  --fcompiler=gnu95  GNU Fortran 95 compiler (4.4.0)<br>
Compilers available for this platform, but not found:<br>
  --fcompiler=absoft   Absoft Corp Fortran Compiler<br>
  --fcompiler=compaq   Compaq Fortran Compiler<br>
  --fcompiler=g95      G95 Fortran Compiler<br>
  --fcompiler=intel    Intel Fortran Compiler for 32-bit apps<br>
  --fcompiler=intele   Intel Fortran Compiler for Itanium apps<br>
  --fcompiler=intelem  Intel Fortran Compiler for EM64T-based apps<br>
  --fcompiler=lahey    Lahey/Fujitsu Fortran 95 Compiler<br>
  --fcompiler=nag      NAGWare Fortran 95 Compiler<br>
  --fcompiler=pg       Portland Group Fortran Compiler<br>
  --fcompiler=vast     Pacific-Sierra Research Fortran 90 Compiler<br>
Compilers not available on this platform:<br>
  --fcompiler=hpux     HP Fortran 90 Compiler<br>
  --fcompiler=ibm      IBM XL Fortran Compiler<br>
  --fcompiler=intelev  Intel Visual Fortran Compiler for Itanium apps<br>
  --fcompiler=intelv   Intel Visual Fortran Compiler for 32-bit apps<br>
  --fcompiler=mips     MIPSpro Fortran Compiler<br>
  --fcompiler=none     Fake Fortran compiler<br>
  --fcompiler=sun      Sun or Forte Fortran 95 Compiler<br>
For compiler details, run 'config_fc --verbose' setup command.<br>
------<br>
Importing numpy.distutils.cpuinfo ... ok<br>
------<br>
CPU information: CPUInfoBase__get_nbits getNCPUs has_mmx has_sse<br>
has_sse2 has_sse3 has_ssse3 is_32bit is_Intel is_i686 ------<br>
<br>
<br>
<br>
--<br>
<font color="#888888">Gökhan<br>
</font></blockquote></div><br><br clear="all"><br></div></div>-- <br><font color="#888888">Gökhan<br>
</font></blockquote></div><br><br clear="all"><br>-- <br>Gökhan<br>