[Numpy-discussion] numpy distutils and distribute

Darren Dale dsdale24@gmail....
Sat Nov 14 10:13:31 CST 2009


On Sat, Nov 14, 2009 at 10:42 AM, Gökhan Sever <gokhansever@gmail.com> wrote:
> On Sat, Nov 14, 2009 at 9:29 AM, Darren Dale <dsdale24@gmail.com> wrote:
>>
>> Please excuse the cross-post. I have installed distribute-0.6.8 and
>> numpy-svn into my ~/.local/lib/python2.6/site-packages (using "python
>> setup.py install --user"). I am now trying to install Enthought's
>> Enable from a fresh svn checkout on ubuntu karmic:
>>
>> $ python setup.py develop --user
>> [...]
>> building library "agg24_src" sources
>> building library "kiva_src" sources
>> building extension "enthought.kiva.agg._agg" sources
>> building extension "enthought.kiva.agg._plat_support" sources
>> building data_files sources
>> build_src: building npy-pkg config files
>> running build_clib
>> customize UnixCCompiler
>> customize UnixCCompiler using build_clib
>> running build_ext
>> build_clib already run, it is too late to ensure in-place build of
>> build_clib
>> Traceback (most recent call last):
>>  File "setup.py", line 327, in <module>
>>    **config
>>  File
>> "/home/darren/.local/lib/python2.6/site-packages/numpy/distutils/core.py",
>> line 186, in setup
>>    return old_setup(**new_attr)
>>  File "/usr/lib/python2.6/distutils/core.py", line 152, in setup
>>    dist.run_commands()
>>  File "/usr/lib/python2.6/distutils/dist.py", line 975, in run_commands
>>    self.run_command(cmd)
>>  File "/usr/lib/python2.6/distutils/dist.py", line 995, in run_command
>>    cmd_obj.run()
>>  File
>> "/home/darren/.local/lib/python2.6/site-packages/numpy/distutils/command/build_ext.py",
>> line 74, in run
>>    self.library_dirs.append(build_clib.build_clib)
>> UnboundLocalError: local variable 'build_clib' referenced before
>> assignment
>>
>
> Darren,
>
> I had a similar installation error. Could you try the solution that was
> given in this thread?
>
> http://www.mail-archive.com/numpy-discussion@scipy.org/msg19798.html

Thanks!

Here is the diff, could someone with knowledge of numpy's distutils
have a look and consider committing it?

Index: numpy/distutils/command/build_ext.py
===================================================================
--- numpy/distutils/command/build_ext.py        (revision 7734)
+++ numpy/distutils/command/build_ext.py        (working copy)
@@ -61,6 +61,7 @@
                 if self.distribution.have_run.get('build_clib'):
                     log.warn('build_clib already run, it is too late to ' \
                             'ensure in-place build of build_clib')
+                    build_clib =
self.distribution.get_command_obj('build_clib')
                 else:
                     build_clib =
self.distribution.get_command_obj('build_clib')
                     build_clib.inplace = 1


More information about the NumPy-Discussion mailing list