我下载了Cython,并按照此处的说明进行操作:http://cython.readthedocs.io/en/latest/src/tutorial/appendix.html
我已经有了MinGW编译器
我使用的是python3而不是python2,但是根据此视频(https://www.youtube.com/watch?v=mXuEoqK4bEc&vl=en),看起来一个人只能使用python 3。 无论如何,当我尝试执行命令python setup.py build_ext --inplace时(与视频不同,必须编写python而不是python3,否则它甚至不会开始运行),我得到以下错误消息: / p>
Traceback (most recent call last):
File "setup.py", line 4, in <module>
setup(ext_modules = cythonize('cython_example.pyx'))
File "C:\Program Files\Python37\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "C:\Program Files\Python37\lib\distutils\dist.py", line 966, in run_commands
self.run_command(cmd)
File "C:\Program Files\Python37\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Program Files\Python37\lib\distutils\command\build_ext.py", line 308, in run force=self.force)
File "C:\Program Files\Python37\lib\distutils\ccompiler.py", line 1031, in new_compiler
return klass(None, dry_run, force)
File "C:\Program Files\Python37\lib\distutils\cygwinccompiler.py", line 282, in __init__
CygwinCCompiler.__init__ (self, verbose, dry_run, force)
File "C:\Program Files\Python37\lib\distutils\cygwinccompiler.py", line 157, in __init__
self.dll_libraries = get_msvcr()
File "C:\Program Files\Python37\lib\distutils\cygwinccompiler.py", line 86, in get_msvcr
raise ValueError("Unknown MS Compiler version %s " % msc_ver)
ValueError: Unknown MS Compiler version 1914