Trying to get "Iron scipy" working - VS crash when trying to set interpreter options

May 2, 2012 at 2:58 PM
Edited May 2, 2012 at 3:04 PM

Hi

I am trying to get scipy working with IronPython. I am getting the error

>>> import scipy

Traceback (most recent call last): 

File "<string>", line 1, in <module> 

File "c:\Program Files\IronPython 2.7\lib\site-packages\scipy\__init__.py", line 124, in <module>    pkgload = PackageLoader() 

File "c:\Program Files\IronPython 2.7\lib\site-packages\numpy\_import_tools.py", line 15, in __init__    self.parent_frame = frame = sys._getframe(_level)

AttributeError: 'module' object has no attribute '_getframe'

so I try the command prompt am trying to set -X:Frames. I run

ipy -X:Frames -c "import scipy"

from the command line and it runs okay but then returns to the command prompt rather than into the ipy command line with scipy loaded. Think I must be misunderstanding this.

However, I also want to run this from within VS so I try and set the Tools>Options>Interactive Windows>Interpreter Options with the value "-X:Frames" (no quotes) for the IronPython settings. When I try and change values on this form, the following rte is encountered.

************** Exception Text **************System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.   at System.Collections.Generic.Dictionary`2.get_Item(TKey key)   at Microsoft.PythonTools.Options.PythonInteractiveOptionsControl.get_CurrentOptions()   at Microsoft.PythonTools.Options.PythonInteractiveOptionsControl._executionMode_TextChanged(Object sender, EventArgs e)   at System.Windows.Forms.Control.OnTextChanged(EventArgs e)   at System.Windows.Forms.ComboBox.OnTextChanged(EventArgs e)   at System.Windows.Forms.Control.set_Text(String value)   at System.Windows.Forms.ComboBox.set_Text(String value)   at System.Windows.Forms.ComboBox.UpdateText()   at System.Windows.Forms.ComboBox.WmReflectCommand(Message& m)   at System.Windows.Forms.ComboBox.WndProc(Message& m)   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)   at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)   at System.Windows.Forms.UnsafeNativeMethods.SendMessage(HandleRef hWnd, Int32 msg, IntPtr wParam, IntPtr lParam)   at System.Windows.Forms.Control.SendMessage(Int32 msg, IntPtr wparam, IntPtr lparam)   at System.Windows.Forms.Control.ReflectMessageInternal(IntPtr hWnd, Message& m)   at System.Windows.Forms.Control.WmCommand(Message& m)   at System.Windows.Forms.Control.WndProc(Message& m)   at System.Windows.Forms.ScrollableControl.WndProc(Message& m)   at System.Windows.Forms.UserControl.WndProc(Message& m)   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

************** Loaded Assemblies **************mscorlib    Assembly Version: 4.0.0.0    Win32 Version: 4.0.30319.431 (RTMLDR.030319-4300)    CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll----------------------------------------Microsoft.VisualStudio.Platform.AppDomainManager    Assembly Version: 10.0.0.0    Win32 Version: 10.0.30319.1    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Microsoft.VisualStudio.Platform.AppDomainManager/v4.0_10.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualStudio.Platform.AppDomainManager.dll----------------------------------------System    Assembly Version: 4.0.0.0    Win32 Version: 4.0.30319.431 built by: RTMLDR    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll----------------------------------------System.Windows.Forms    Assembly Version: 4.0.0.0    Win32 Version: 4.0.30319.1 built by: RTMRel    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll----------------------------------------System.Drawing    Assembly Version: 4.0.0.0    Win32 Version: 4.0.30319.1 built by: RTMRel    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll----------------------------------------Microsoft.VisualStudio.Shell.10.0    Assembly Version: 10.0.0.0    Win32 Version: 10.0.40219.1    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Microsoft.VisualStudio.Shell.10.0/v4.0_10.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualStudio.Shell.10.0.dll----------------------------------------System.Core    Assembly Version: 4.0.0.0    Win32 Version: 4.0.30319.431 built by: RTMLDR    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll----------------------------------------Microsoft.VisualStudio.OLE.Interop    Assembly Version: 7.1.40304.0    Win32 Version: 7.10.6070    CodeBase: file:///C:/Windows/assembly/GAC/Microsoft.VisualStudio.OLE.Interop/7.1.40304.0__b03f5f7f11d50a3a/Microsoft.VisualStudio.OLE.Interop.dll----------------------------------------WindowsBase    Assembly Version: 4.0.0.0    Win32 Version: 4.0.30319.431 built by: RTMLDR    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/WindowsBase/v4.0_4.0.0.0__31bf3856ad364e35/WindowsBase.dll-

---------------------------------------PresentationFramework

 

etc etc.

When I do try and open the Ironpython interactive window, I still get the same _getname type error. Here are the versions I am using.

Microsoft Visual Studio 2010Version 10.0.40219.1 SP1RelMicrosoft .NET FrameworkVersion 4.0.30319 SP1Rel
Installed Version: Professional
Microsoft Office Developer Tools   01018-532-2002102-70180Microsoft Office Developer Tools
Microsoft Visual Basic 2010   01018-532-2002102-70180Microsoft Visual Basic 2010
Microsoft Visual C# 2010   01018-532-2002102-70180Microsoft Visual C# 2010
Microsoft Visual C++ 2010   01018-532-2002102-70180Microsoft Visual C++ 2010
Microsoft Visual F# 2010   01018-532-2002102-70180Microsoft Visual F# 2010
Microsoft Visual Studio 2010 Team Explorer   01018-532-2002102-70180Microsoft Visual Studio 2010 Team Explorer
Microsoft Visual Web Developer 2010   01018-532-2002102-70180Microsoft Visual Web Developer 2010
Crystal Reports Templates for Microsoft Visual Studio 2010   Crystal Reports Templates for Microsoft Visual Studio 2010
Microsoft Python Tools for Visual Studio   1.1.50409.0Python Tools for Visual Studio provides intellisense, project support, project and item templates, as well as a REPL window for Python development.
Microsoft Python Tools for Visual Studio - Profiling Support   1.1.50409.0Profiling support for Python projects.
Microsoft Visual Studio 2010 Professional - ENU Service Pack 1 (KB983509)   KB983509This service pack is for Microsoft Visual Studio 2010 Professional - ENU.If you later install a more recent service pack, this service pack will be uninstalled automatically.For more information, visit http://support.microsoft.com/kb/983509.
Update for Microsoft Visual Studio 2010 Professional - ENU (KB0000001)   KB0000001v2This update is for Microsoft Visual Studio 2010 Professional - ENU.If you later install a more recent service pack, this update will be uninstalled automatically.For more information, visit http://support.microsoft.com/kb/0000001.

I should add that the Interpreter options seems to hold if I go back in and check the value.

Many thanks in advance

Simon