如何获得 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?

查看:20
本文介绍了如何获得 64 位 Anaconda Python 以在 Windows 上找到 Cython 的 MS C 编译器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何获得 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.

我已经安装了 MS Visual C++ for Python,并且在该目录中看到了 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),然后我安装了 Visual Studio 2019,遵循了 https://pythondev.readthedocs.io/windows.html 以获得正确的编译器.执行此 cython 将从 *.pyx 代码创建 *.c 文件,然后编译器创建 *.pyd 代码并执行.终于解脱了!n.

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆