我尝试使用Cython和MSVC Microsoft Visual C++ Compiler Package for Python 2.7
在Windows上使用Python 2.7源代码构建exe文件。
我使用以下教程:https://github.com/cython/cython/wiki/CythonExtensionsOnWindows
我遵循所有步骤。我没有得到任何错误,但没有exe文件。有什么不好?为什么msvc不生成exe文件或错误?
所有命令均从Visual C++ 2008 32-bit Command Prompt
执行。生成的test.c
文件有67 kB。
c:\Users\martin\PycharmProjects\untitled>type test.py
print "Hello World!"
c:\Users\martin\PycharmProjects\untitled>python test.py
Hello World!
c:\Users\martin\PycharmProjects\untitled>cython test.py
c:\Users\martin\PycharmProjects\untitled>SET DISTUTILS_USE_SDK=1
c:\Users\martin\PycharmProjects\untitled>SET MSSdk=1
c:\Users\martin\PycharmProjects\untitled>type setup.py
try:
from setuptools import setup
from setuptools import Extension
except ImportError:
from distutils.core import setup
from distutils.extension import Extension
c:\Users\martin\PycharmProjects\untitled>
c:\Users\martin\PycharmProjects\untitled>python setup.py build_ext --inplace --compiler=msvc
c:\Users\martin\PycharmProjects\untitled>