[SciPy-user] building numpy fails

Steve Schmerler elcorto at gmx.net
Sun Apr 2 11:09:20 CDT 2006


The latest numpy svn checkout fails to build (Python 2.3.5) when trying 
to call tempfile.mktemp(). The module index says:

mktemp([suffix[, prefix[, dir]]])
	Deprecated since release 2.3. Use mkstemp() instead.
     	[...]	

------------------------------------------------------------------------------------
[...]

Traceback (most recent call last):
   File "setup.py", line 84, in ?
     setup_package()
   File "setup.py", line 77, in setup_package
     setup( configuration=configuration )
   File 
"/home/elcorto/install/python/scipy/svn/numpy/numpy/distutils/core.py", 
line 152, in setup
     return old_setup(**new_attr)
   File "/usr/lib/python2.3/distutils/core.py", line 149, in setup
     dist.run_commands()
   File "/usr/lib/python2.3/distutils/dist.py", line 907, in run_commands
     self.run_command(cmd)
   File "/usr/lib/python2.3/distutils/dist.py", line 927, in run_command
     cmd_obj.run()
   File 
"/home/elcorto/install/python/scipy/svn/numpy/numpy/distutils/command/install.py", 
line 11, in run
     r = old_install.run(self)
   File "/usr/lib/python2.3/distutils/command/install.py", line 506, in run
     self.run_command('build')
   File "/usr/lib/python2.3/distutils/cmd.py", line 333, in run_command
     self.distribution.run_command(command)
   File "/usr/lib/python2.3/distutils/dist.py", line 927, in run_command
     cmd_obj.run()
   File "/usr/lib/python2.3/distutils/command/build.py", line 107, in run
     self.run_command(cmd_name)
   File "/usr/lib/python2.3/distutils/cmd.py", line 333, in run_command
     self.distribution.run_command(command)
   File "/usr/lib/python2.3/distutils/dist.py", line 927, in run_command
     cmd_obj.run()
   File 
"/home/elcorto/install/python/scipy/svn/numpy/numpy/distutils/command/build_src.py", 
line 84, in run
     self.build_sources()
   File 
"/home/elcorto/install/python/scipy/svn/numpy/numpy/distutils/command/build_src.py", 
line 103, in build_sources
     self.build_extension_sources(ext)
   File 
"/home/elcorto/install/python/scipy/svn/numpy/numpy/distutils/command/build_src.py", 
line 209, in build_extension_sources
     sources = self.generate_sources(sources, ext)
   File 
"/home/elcorto/install/python/scipy/svn/numpy/numpy/distutils/command/build_src.py", 
line 267, in generate_sources
     source = func(extension, build_dir)
   File "numpy/core/setup.py", line 35, in generate_config_h
     library_dirs = default_lib_dirs)
   File "/usr/lib/python2.3/distutils/command/config.py", line 278, in 
try_run
     self._check_compiler()
   File 
"/home/elcorto/install/python/scipy/svn/numpy/numpy/distutils/command/config.py", 
line 35, in _check_compiler
     self.fcompiler.customize(self.distribution)
   File 
"/home/elcorto/install/python/scipy/svn/numpy/numpy/distutils/fcompiler/__init__.py", 
line 294, in customize
     oflags = self.__get_flags(self.get_flags_opt,'FOPT',(conf,'opt'))
   File 
"/home/elcorto/install/python/scipy/svn/numpy/numpy/distutils/fcompiler/__init__.py", 
line 511, in __get_flags
     var = command()
   File 
"/home/elcorto/install/python/scipy/svn/numpy/numpy/distutils/fcompiler/gnu.py", 
line 122, in get_flags_opt
     if self.get_version()<='3.3.3':
   File 
"/home/elcorto/install/python/scipy/svn/numpy/numpy/distutils/ccompiler.py", 
line 251, in CCompiler_get_version
     status, output = exec_command(cmd,use_tee=0)
   File 
"/home/elcorto/install/python/scipy/svn/numpy/numpy/distutils/exec_command.py", 
line 254, in exec_command
     use_tee=use_tee,
   File 
"/home/elcorto/install/python/scipy/svn/numpy/numpy/distutils/exec_command.py", 
line 279, in _exec_command_posix
     tmpfile = tempfile.mktemp()
AttributeError: 'module' object has no attribute 'mktemp'
------------------------------------------------------------------------------------

Replacing mktemp() by mkstemp() doesn't help:

[...]
   File 
"/home/elcorto/install/python/scipy/svn/numpy/numpy/distutils/exec_command.py", 
line 279, in _exec_command_posix
     tmpfile = tempfile.mkstemp()
AttributeError: 'module' object has no attribute 'mkstemp'

but doing it in an interactive session works:

In [1]: import tempfile

In [2]: tempfile.mkstemp()
Out[2]: (3, '/tmp/tmp0Iv8K7')

What's going on?

cheers,
steve

-- 
Random number generation is the art of producing pure gibberish as 
quickly as possible.



More information about the SciPy-user mailing list