windows准备用Cython打包代码,发现没那么简单,首先就一个错误
D:\sheiruan\python\Project>python setup.py build_ext
running build_ext
building 'live_rank' extension
error: Unable to find vcvarsall.bat
出现错误,好像是没vc,比较简单的方法是安装http://www.mingw-w64.org/
结果安装完并没有解决
D:\sheiruan\python\Project>python setup.py build_ext
running build_ext
Traceback (most recent call last):
File "D:\sheiruan\python\Project\setup.py", line 4, in <module>
setup(
File "C:\Python39\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "C:\Python39\lib\distutils\dist.py", line 966, in run_commands
self.run_command(cmd) File "C:\Python39\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Python39\lib\distutils\command\build_ext.py", line 306, in run
self.compiler = new_compiler(compiler=self.compiler,
File "C:\Python39\lib\distutils\ccompiler.py", line 1032, in new_compiler
return klass(None, dry_run, force)
File "C:\Python39\lib\distutils\cygwinccompiler.py", line 280, in __init__
CygwinCCompiler.__init__ (self, verbose, dry_run, force)
File "C:\Python39\lib\distutils\cygwinccompiler.py", line 124, in __init__
if self.ld_version >= "2.10.90":TypeError: '>=' not supported between instances of 'NoneType' and 'str'
出现新的错误,继续发现https://wiki.python.org/moin/WindowsCompilers,下载vs
好吧轻松解决,虽然安装包有点大,mingw-w64会出错,弃用了,不知道原因









网友评论