gpt4 book ai didi

python - 编译 cython Hello World 示例 : don't know how to compile C/C++ code on platform

转载 作者:行者123 更新时间:2023-12-04 11:16:59 25 4
gpt4 key购买 nike

每当我尝试编译 simpleset cython 示例时

Hello World .pyx

print "Hello World"

设置文件
from distutils.core import setup
from Cython.Build import cythonize
setup(
ext_modules = cythonize("helloworld.pyx")
)

我正在接收
c:\> python setup.py build_ext --inplace --compiler=c:\cygwin64\bin\gcc
running build_ext
error: don't know how to compile C/C++ code on platform 'nt' with 'c:\cygwin64\bin\gcc' compiler

我可能做错了什么?

附言我在用
Python 3.6.0 |Anaconda 4.3.1 (64-bit)| (default, Dec 23 2016, 11:57:41) [MSC v.1900 64 bit (AMD64)] on win32

最佳答案

我不知道 Cython,但您可以执行以下操作:
将 c:\cygwin64\bin\添加到 PATH .然后,而不是:

python setup.py build_ext --inplace --compiler=c:\cygwin64\bin\gcc
跑:
python setup.py build_ext --inplace

关于python - 编译 cython Hello World 示例 : don't know how to compile C/C++ code on platform,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44418343/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com