试图构建一个Cython文件 - 获取错误(Python 2.7,Windows 7 64位)

时间:2013-02-02 23:02:21

标签: python cython

我在Windows Powershell中使用Python 2.7(我设置环境以便使用Python)。

我安装了Cython(使用Windows安装程序)。

我正在尝试通过制作一个简单的“Hello World”扩展来关注Cython网站上的教程,但是当我尝试构建扩展时,我收到此错误:

dllwrap: gcc exited with status 1
error: command 'dllwrap' failed with exit status 1

如何解决这个问题,以便我可以通过C扩展来优化我的python代码?

1 个答案:

答案 0 :(得分:0)

以下是错误代码的其余部分:

Windows PowerShell
Copyright (C) 2009 Microsoft Corporation. All rights reserved.

PS C:\Users\Pinky> cd Programming
PS C:\Users\Pinky\Programming> python setup.py build_ext --inplace
running build_ext
skipping 'helloworld.c' Cython extension (up-to-date)
building 'helloworld' extension
C:\MinGW\bin\gcc.exe -mdll -O -Wall -IC:\Python27\include -IC:\Python27\PC -c helloworld.c -o build\temp.win32-2.7\Relea
se\helloworld.o
writing build\temp.win32-2.7\Release\helloworld.def
C:\MinGW\bin\dllwrap.exe -mdll -static --output-lib build\temp.win32-2.7\Release\libhelloworld.a --def build\temp.win32-
2.7\Release\helloworld.def -s build\temp.win32-2.7\Release\helloworld.o -LC:\Python27\libs -LC:\Python27\PCbuild -lpytho
n27 -lmsvcr90 -o C:\Users\Pinky\Programming\helloworld.pyd
helloworld.exp: file not recognized: File format not recognized
collect2: ld returned 1 exit status
dllwrap: gcc exited with status 1
error: command 'dllwrap' failed with exit status 1
PS C:\Users\Pinky\Programming>