在Visual Studio中使用NumPy [英] Using NumPy in Visual Studio

查看:1566
本文介绍了在Visual Studio中使用NumPy的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我下载了 http://pytools.codeplex.com/(适用于Visual Studio的Python工具),我可以在Visual Studio中编写Python.

I downloaded http://pytools.codeplex.com/ (Python Tools for Visual Studio) so that I could write Python in Visual Studio.

问题是,当我尝试像这样使用最基本的软件包"numpy"时:

The problem is when I try to use the most basic package "numpy" like so:

import numpy

上面写着"没有名为'numpy'的模块."

如何在Visual Studio中使用NumPy和SciPy?

How can I use NumPy and SciPy in Visual Studio?

注意:我在另一台运行良好的机器上使用 Canopy Expres ;但是,由于已经安装了Visual Studio,所以我不想在此计算机上安装它.

Note: I am using Canopy Express on another machine which works perfectly; however, I don't want to install it on this machine since I already have Visual Studio installed.

我通过右键单击Python环境并单击添加环境,将Python 3.3环境添加到我的Python解决方案"中.但是,右键单击我的环境并单击安装Python软件包后,我输入"numpy"并在尝试安装它时收到此错误:

I added the Python 3.3 environment to my Python "solution" by right-clicking Python environments and clicking add an environment. But, after right-clicking my environment and clicking install Python package, I typed in "numpy" and got this error when trying to install it:

...
creating build
creating build\src.win32-3.3
creating build\src.win32-3.3\numpy
creating build\src.win32-3.3\numpy\distutils
building library "npymath" sources
No module named 'numpy.distutils.msvccompiler' in numpy.distutils; trying from distutils
error: Unable to find vcvarsall.bat
----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in c:\users\dom\appdata\local\temp\pip_build_Dom\numpy
Storing complete log in C:\Users\Dom\pip\pip.log
'numpy' failed to install. Exit code: 1

如何安装NumPy?

推荐答案

考虑使用功能更丰富的Windows Python发行版,例如 Anaconda .它带有安装包中包含的大量软件包.对于那些不熟悉Python的人来说,这非常方便,尤其是在使用Windows的时候.

Consider using a more feature-rich Windows distribution of Python, like Anaconda. It comes with a boatload of packages included into the installer. This is quite handy for those who are new to Python, especially when they are using Windows.

这篇关于在Visual Studio中使用NumPy的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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