cox-labs/PluginInterop

Plugin crashes when python is not in path

Closed this issue · 2 comments

Hello Jan,

I was able to note that when trying to use the python version of the service, I got an error message and I suppose it is because indeed I do not have a c/program files/python directory (because my python dirs are c/python36/ and c/python27/, both of which are in my path).

I have not been able to pinpoint exactly where in the code this happens here goes the full error log... apparently somewhere in PluginInterop/Python/Utils.TryFindPythonExecutable

See the end of this message for details on invoking 
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\Program Files\Python'.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.FileSystemEnumerableIterator`1.CommonInit()
   at System.IO.Directory.EnumerateDirectories(String path, String searchPattern)
   at PluginInterop.Python.Utils.TryFindPythonExecutable(String& path)
   at PluginInterop.Python.MatrixProcessing.TryFindExecutable(String& path)
   at PluginInterop.Python.MatrixProcessing.ExecutableParam()
   at PluginInterop.MatrixProcessing.GetParameters(IMatrixData mdata, String& errString)
   at PerseusLibS.Data.Matrix.MatrixData.GetProcessingParameters(IProcessing processing, String& errorString)
   at PerseusLib.Forms.PerseusMainControl.GetParameters(IProcessing processing, InternalData mdata)
   at PerseusLib.Forms.PerseusMainControl.Processing(IProcessing processing, DataType2 type)
   at PerseusLib.Forms.PerseusMainControl.<Init>b__103_2(Object sender)
   at PerseusLib.Forms.PerseusMainControl.<>c__DisplayClass97_0.<AddActivity>b__0(Object sender, EventArgs args)
   at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
   at System.Windows.Forms.ToolStripMenuItem.OnClick(EventArgs e)
   at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
   at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
   at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
   at System.Windows.Forms.ToolStripDropDown.OnMouseUp(MouseEventArgs mea)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ToolStrip.WndProc(Message& m)
   at System.Windows.Forms.ToolStripDropDown.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

python not found

Thank you very much for your attention,
Sebastian

Thanks for reporting this issue! It is really hard to test all the different possible setups. :-/
there was an issue with non-existent directories being checked which should be resolved now. can you confirm?

08819ac

Seems solved on my system (does not find the executable due to the non standard naming but it does not throw the error).

Thanks for the quick fix