Python 3.x 非致命的IronPython NumPy异常
我按照他们的指示为IronPython安装了Enthough 包括import numpy和import scipy在内的一切似乎都正常工作,但在IronPython程序中使用这些语句会导致以下异常: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
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秒,这简直是个时间杀手。哦,好吧。