1

I get this error when compile hello.py with "python setup.py build_ext --inplace" . I have searched for the error but get nothing. Has anyone ever solved a similar problem? 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
Hunter
  • 11
  • 3
  • I don't think this will solve your issue, but you should call it "hello.pyx" and not "hello.py", otherwise python will get confused when you import hello – ead Oct 04 '17 at 05:56
  • It looks like your module wasn't cythonized at all, but the c-compiler were called directly. What happens if you call `python -m cython hello.pyx` (after renaming hello.py to hello.pyx of cause) on the command line? – ead Oct 04 '17 at 06:02
  • It will get .c file as before. I have installed a win10 vm today and get .pyd finally. The whole thing is realy headachy – Hunter Oct 04 '17 at 13:48

0 Answers0