.py
转换为.pyd
dll。每次我都尝试执行安装脚本。
from distutils.core import setup
from distutils.extension import Extension
from Cython.Distutils import build_ext
ext_modules = [
Extension("core", ["core.py"]),
]
setup(
name = 'core',
cmdclass = {'build_ext': build_ext},
ext_modules = ext_modules
)
我收到此错误:
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: cannot find -lvcruntime140.dll
collect2.exe: error: ld returned 1 exit status
error: command 'C:\\MinGW\\bin\\gcc.exe' failed with exit status 1
答案 0 :(得分:0)
我的问题已使用以下命令解决:
cython
将脚本转换为C代码: cython -3 main.py
.c
转换为.pyd
dll: gcc main.c -o main.pyd -shared -IC:\Python36\include -LC:\Python36\libs -lpython36