2014-06-18 29 views
6

Quando si tenta di costruire un minimo di file test.pyx Cython con Python 3.3 (Anaconda 3) sotto Windows 7, ottengo uno strano errore:Costruire file di Cython minimal con Python 3.3 (Anaconda) sotto Windows 7

C:\Users\myname\Test_cython>python setup.py build 
running build 
running build_ext 
error: [WinError 2] The system cannot find the file specified 

Ovviamente test.pyx è nella directory di lavoro. Funziona bene sotto Windows con Python 2.7 (Anaconda) e sotto Linux con Python 2 e 3.

Quale potrebbe essere il problema qui con Python 3.3 (Anaconda 3)?

Grazie

Il file setup.py:

from distutils.core import setup 
from distutils.extension import Extension 
from Cython.Distutils import build_ext 

setup(
    name = 'test', 
    cmdclass = {"build_ext": build_ext}, 
    ext_modules = [Extension('test', ['test.pyx'])] 
    ) 

Soluzione:

Ho trovato che la linea 404 del file cygwinccompiler.py del pacchetto disutils

out_string = check_output(['gcc', '-dumpmachine']) 

deve essere modificato come

out_string = check_output(['gcc', '-dumpmachine'], shell=True) 

Quindi, viene compilato normalmente.

risposta

6

La linea 404 del file cygwinccompiler.py del pacchetto disutils

out_string = check_output(['gcc', '-dumpmachine']) 

deve essere cambiato come

out_string = check_output(['gcc', '-dumpmachine'], shell=True) 

Poi, si compila normalmente.

+1

http://bugs.python.org/issue21821 – asmeurer

Problemi correlati