Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/python-3.x/18.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/visual-studio-2010/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 3.x 非致命的IronPython NumPy异常_Python 3.x_Visual Studio 2010_Numpy_Exception_Ironpython - Fatal编程技术网

Python 3.x 非致命的IronPython NumPy异常

Python 3.x 非致命的IronPython NumPy异常,python-3.x,visual-studio-2010,numpy,exception,ironpython,Python 3.x,Visual Studio 2010,Numpy,Exception,Ironpython,我按照他们的指示为IronPython安装了Enthough 包括import numpy和import scipy在内的一切似乎都正常工作,但在IronPython程序中使用这些语句会导致以下异常: A first chance exception of type 'System.Collections.Generic.KeyNotFoundException' occurred in IronPython.dll A first chance exception of type 'Syst

我按照他们的指示为IronPython安装了Enthough

包括import numpy和import scipy在内的一切似乎都正常工作,但在IronPython程序中使用这些语句会导致以下异常:

A first chance exception of type 'System.Collections.Generic.KeyNotFoundException' occurred in IronPython.dll

A first chance exception of type 'System.MissingMemberException' occurred in Microsoft.Dynamic.dll

A first chance exception of type 'System.MissingMemberException' occurred in IronPython.dll

A first chance exception of type 'IronPython.Runtime.Exceptions.TypeErrorException' occurred in Snippets.debug.scripting

如何修复这些异常?

我不会担心它们,而且我怀疑它们是否可以被删除。这些都映射到Python异常,这意味着它们可能是保持与CPython兼容所必需的。在CPython中,异常的速度比.NET快几个数量级,因此它们在Python代码中比在C代码中更常用


IronPython通常使用.NET异常机制来显示Python异常,这可能导致某些代码的速度大幅降低。2.7添加一个轻量级异常机制,但它不一致使用的兼容性现在比性能更重要,但我强烈地考虑拉请求。抛出这些异常的一些代码可能会被修改为使用轻量级异常。

看起来可能是我的IronPython版本:2.7.2.1,因为numpy是为特定的ipy版本构建的。我已经降级到IronPython 2.7,但同样的异常会被抛出,在VS2011中启动需要大约10秒。太长了。太糟糕了。要IronPython运行一个使用numpy的10行程序,要等上10秒,这简直是个时间杀手。哦,好吧。