Hello,
I just noticed a block of what I believe is some old redundant code in
pyximport/pyxbuild.py
(http://hg.cython.org/cython-devel/file/019d05a57e89/pyximport/pyxbuild.py).
Lines 64 to 67 should probably be removed:
64 config_files = dist.find_config_files()
65 try: config_files.remove('setup.cfg')
66 except ValueError: pass
67 dist.parse_config_files(config_files)
68
69 cfgfiles = dist.find_config_files()
70 try: cfgfiles.remove('setup.cfg')
71 except ValueError: pass
72 dist.parse_config_files(cfgfiles)
73 try:
74 ok = dist.parse_command_line()
75 except DistutilsArgError:
76 raise
"config_files" isn't used anywhere else in the file. I don't have hg to submit a
patch. I only came across this because I'm still getting this error in Python
2.6.6, Cython 0.13, in Windows 2000 when building a cython module with
pyximport:
ImportError: Building module failed: ['DistutilsPlatformError: Unable to find
vcvarsall.bat\n']
This is in spite of having a Python26/Lib/distutils/distutils.cfg file
containing "[build] compiler = mingw32". Yet it appears that pyximport is still
trying to call msvc to compile the .c file. Here's the full traceback:
Traceback (most recent call last):
File "C:\bzr\spyke\dev\spyke\main.py", line 11, in <module>
from climbing import climb # .pyx file
File "C:\bin\Python26\lib\site-packages\pyximport\pyximport.py", line 328, in
load_module
self.pyxbuild_dir)
File "C:\bin\Python26\lib\site-packages\pyximport\pyximport.py", line 180, in
load_module
so_path = build_module(name, pyxfilename, pyxbuild_dir)
File "C:\bin\Python26\lib\site-packages\pyximport\pyximport.py", line 164, in
build_module
reload_support=pyxargs.reload_support)
File "C:\bin\Python26\lib\site-packages\pyximport\pyxbuild.py", line 86, in
pyx_to_dll
dist.run_commands()
File "C:\bin\Python26\lib\distutils\dist.py", line 975, in run_commands
self.run_command(cmd)
File "C:\bin\Python26\lib\distutils\dist.py", line 995, in run_command
cmd_obj.run()
File "C:\bin\Python26\lib\distutils\command\build_ext.py", line 340, in run
self.build_extensions()
File "C:\bin\Python26\lib\site-packages\Cython\Distutils\build_ext.py", line
81, in build_extensions
self.build_extension(ext)
File "C:\bin\Python26\lib\distutils\command\build_ext.py", line 499, in
build_extension
depends=ext.depends)
File "C:\bin\Python26\lib\distutils\msvc9compiler.py", line 458, in compile
self.initialize()
File "C:\bin\Python26\lib\distutils\msvc9compiler.py", line 368, in initialize
vc_env = query_vcvarsall(VERSION, plat_spec)
File "C:\bin\Python26\lib\distutils\msvc9compiler.py", line 260, in
query_vcvarsall
raise DistutilsPlatformError("Unable to find vcvarsall.bat")
ImportError: Building module failed: ['DistutilsPlatformError: Unable to find
vcvarsall.bat\n']
This was apparently dealt with by a patch last year, related to the code block
above (pyximport ignors [build] compiler = mingw32):
http://codespeak.net/pipermail/cython-dev/2009-May/005417.html
I've dropped into the debugger at line 72 above, and "cfgfiles" has just one
entry that points to my distutils.cfg file. Any ideas? Just as a disclaimer, I'm
using the Cython 0.13 win32 .exe installer from Christoph Gohlke
(http://www.lfd.uci.edu/~gohlke/pythonlibs/#cython)
Cheers,
Martin
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev