这里的第一个问题-感觉像一个愚蠢的问题,我试图寻找不同的东西,但找不到答案。在
我遵循Cython getting started guide并尝试构建我的第一个模块。我的'测试.pyx'文件是:
def say_hello_to(name):
print("Hello %s!" % name)
我的'设置.py'文件是:
^{pr2}$两个文件都位于同一个目录中,即C:\testing。然后我运行:
python setup.py build_ext --inplace
然后得到以下错误(我使用的是Python设置):
C:\Users\Jill3\Anaconda\Scripts\gcc.bat -DMS_WIN64 -mdll -O -Wall -IC:\Users\Jill3\Anaconda\include -IC:\Users\Jill3\Anaconda\PC -c testing.c -o build\temp.win-amd64-2.7\Release\testing.o
gcc.exe: error: testing.c: No such file or directory
gcc.exe: fatal error: no input files
目录中会出现一个testing.c文件,但没有其他文件。在
如果我改变设置.py文件收件人:
from distutils.core import setup
from Cython.Build import cythonize
setup(
name = 'Hello world app',
ext_modules = cythonize("C:\\testing\\testing.pyx")
)
然后一切如期而至。在
我有什么需要调整的吗?还是每次都要包括整个目录路径?在
编辑:我尝试在设置.py文件:
from distutils.core import setup
from Cython.Build import cythonize
import os
setup(
name = 'Hello world app',
ext_modules = cythonize("testing.pyx"),
include_dirs = [os.getcwd()]
)
这反映在输出中,但我仍然看到相同的错误:
C:\Users\Jill3\Anaconda\Scripts\gcc.bat -DMS_WIN64 -mdll -O -Wall -IC:\testing -IC:\Users\Jill3\Anaconda\include -IC:\Users\Jill3\Anaconda\PC -c testing.c -o build\temp.win-amd64-2.7\Release\testing.o
gcc.exe: error: testing.c: No such file or directory
gcc.exe: fatal error: no input files
尝试从测试目录中运行python代码。问题可能出在路径上。在安装期间会出现这种情况,系统会提示您要在何处安装安装安装程序。在你的情况下,试着解决这个问题。在
相关问题 更多 >
编程相关推荐