cl:命令行错误D8003:使用Cython将.py转换为.pyd时缺少源文件名

时间:2017-10-04 03:46:51

标签: python visual-studio cython pyd

使用" python setup.py build_ext --inplace"编译hello.py时出现此错误。我搜索了错误但什么都没得到。有没有人解决过类似的问题? os = win7-64,python = 3.6.2,cython = 0.27.1,visual stdudio = 2015。

# hello.py
def say_hello_to(name):
    print("Hello %s!" % name)

# setup.py
from distutils.core import setup
from Cython.Build import cythonize

setup(
  ext_modules = cythonize("hello.py")
)


E:\Crawler>python setup.py build_ext --inplace
running build_ext
building 'hello' extension
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\cl.exe /c /nologo /Ox
 /W3 /GL /DNDEBUG /MD "-ID:\Program Files (x86)\Python36-32\include" "-ID:\Progr
am Files (x86)\Python36-32\include" "-IC:\Program Files (x86)\Microsoft Visual S
tudio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10
240.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" "-
IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program F
iles (x86)\Windows Kits\10\include\10.0.10240.0\ucrt" "-IC:\Program Files (x86)\
Windows Kits\NETFXSDK\4.6.1\include\um" "-IC:\Program Files\Microsoft SDKs\Windo
ws\v7.0\Include\" /Tchello.c /Fobuild\temp.win32-3.6\Release\hello.obj
cl : Command line error D8003 : missing source filename
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\
cl.exe' failed with exit status 2

0 个答案:

没有答案