Numpy backwards compatibility: Visual C++ 9 not found

安稳与你 提交于 2019-12-02 07:22:34

Python 2.7 uses Visual Studio 9, which came out in 2008. When you're building Python extensions, you must use the same compiler that the package was built with. So unfortunately, you'll have to download it if you want to build it yourself. You may be able to use the Microsoft Visual C++ Compiler for Python 2.7, but I haven't tested it with numpy.

On the other hand, if you don't want to download a new compiler (You can't even find Visual Studio 9 via Microsoft's website anymore), you can download a pre-built wheel from Christoph Gohlke's website. If you don't have a good reason to build it yourself, I recommend doing that. You can download the numpy wheel, and then pip install "C:\path\to\numpy‑1.9.3+mkl‑cp27‑none‑win_amd64.whl".

There are ways to build the extensions with some version of MinGW somewhere, but I'm not sure how to do it. Christoph Gohlke's extensions work nicely though, and I would recommend just downloading those.

Microsoft maintains separate pages for python compilers. This link is what you want. Its a quick download and install. No need for pip wheel or anything.

https://www.microsoft.com/en-us/download/details.aspx?id=44266

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!