我如何获得64位Anaconda Python在Windows上为Cython找到MS C编译器? [英] How can I get 64-bit Anaconda Python to find the MS C compiler for Cython on Windows?
问题描述
如何获取64位Anaconda Python在Windows上为Cython找到MS C编译器?
How can I get 64-bit Anaconda Python to find the MS C compiler for Cython on Windows?
在Anaconda Python中,您运行setup.py文件来编译* .pyx源代码文件.Anaconda Python 2.7足够聪明,可以意识到它需要MS 9.0编译器,但抱怨找不到vcvarsall.bat文件.
In Anaconda Python you run a setup.py file to compile a *.pyx source code file. Anaconda Python 2.7 is smart enough to realize it needs the MS 9.0 compiler but it complains it can’t find the vcvarsall.bat file.
我已经安装了适用于Python的MS Visual C ++,并且在该目录中看到vcvarsall.bat文件.
I’ve installed the MS Visual C++ for Python and I see the vcvarsall.bat file in that directory.
是否可以在setup.py文件中放置命令来告诉Anaconda Python 64位MS C编译器在哪里?
Is there a way to put a command in the setup.py file to tell Anaconda Python where the 64-bit MS C-compiler is?
谢谢你,尼尔
推荐答案
问题已解决.我卸载了Anaconda 2,并安装了Anaconda 3(这将安装Python 3.7),然后按照 https://pythondev.readthedocs.io/windows.html 即可获取正确的编译器.执行此cython程序将通过* .pyx代码创建* .c文件,然后编译器将创建* .pyd代码并执行该程序.终于解脱了!.
Problem now solved. I uninstalled Anaconda 2, and installed Anaconda 3 (this installing Python 3.7), then i installed Visual Studio 2019 followed tips on https://pythondev.readthedocs.io/windows.html to get the correct compiler. Doing this cython creates the *.c file from the *.pyx code and the compiler then creates the *.pyd code and this executes. What a relief! n.
这篇关于我如何获得64位Anaconda Python在Windows上为Cython找到MS C编译器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!