尝试构建 cython 文件 - 获取错误(Python 2.7,Windows 7 64 位)



我在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 代码?

以下是其余的错误代码:

Windows PowerShell
Copyright (C) 2009 Microsoft Corporation. All rights reserved.
PS C:UsersPinky> cd Programming
PS C:UsersPinkyProgramming> python setup.py build_ext --inplace
running build_ext
skipping 'helloworld.c' Cython extension (up-to-date)
building 'helloworld' extension
C:MinGWbingcc.exe -mdll -O -Wall -IC:Python27include -IC:Python27PC -c helloworld.c -o buildtemp.win32-2.7Relea
sehelloworld.o
writing buildtemp.win32-2.7Releasehelloworld.def
C:MinGWbindllwrap.exe -mdll -static --output-lib buildtemp.win32-2.7Releaselibhelloworld.a --def buildtemp.win32-
2.7Releasehelloworld.def -s buildtemp.win32-2.7Releasehelloworld.o -LC:Python27libs -LC:Python27PCbuild -lpytho
n27 -lmsvcr90 -o C:UsersPinkyProgramminghelloworld.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:UsersPinkyProgramming>

最新更新