Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/344.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
试图构建Cython文件获取错误(Python 2.7,Windows 7 64位)_Python_Cython - Fatal编程技术网

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

试图构建Cython文件获取错误(Python 2.7,Windows 7 64位),python,cython,Python,Cython,我正在Windows Powershell中使用Python2.7(我设置了环境以便可以使用Python) 我已安装Cython(使用Windows安装程序) 我试图按照Cython网站上的教程制作一个简单的“Hello World”扩展,但是当我尝试构建扩展时,我遇到了以下错误: dllwrap: gcc exited with status 1 error: command 'dllwrap' failed with exit status 1 如何解决此问题,以便通过C扩展优化pytho

我正在Windows Powershell中使用Python2.7(我设置了环境以便可以使用Python)

我已安装Cython(使用Windows安装程序)

我试图按照Cython网站上的教程制作一个简单的“Hello World”扩展,但是当我尝试构建扩展时,我遇到了以下错误:

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:\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>

在退出状态为1的
gcc行上方是否有任何相关错误数据?它退出的事实并没有提供足够的信息。您好,下面是代码的其余部分:可能重复的Setup.py是应该应用C代码(或其他东西)并将我的python文件转换为Cython扩展名的文件。它来自本教程:它仍然不起作用。我将Ming/bin放在环境路径的开头附近,从compiler.py中删除了-mno cygwin。。它仍然给我错误。我设法解决了它。我忘了在MingGW中输入“C:\”,您还需要在powershell中输入它来设置它的环境:$env:path=“C:\MinGW\bin;”“+$env:path”\35;编辑您的答案以包含您如何解决自己问题的全部细节是值得的。很高兴听到你把它整理好了。