<div dir="ltr"><div class="gmail_quote"><div dir="ltr">Hi All,</div><div dir="ltr"><br><div>  So, the issue I'm running into is in combining pyinstaller with pythonnet.  I'll describe my current situation.  Hopefully it isn't too long and you have some insight.</div>

<div><br></div><div>  I have a little bit of UI put together via Windows forms.  I can run it fine via pythonnet by doing "clr.AddReference('System.Windows.Forms')" to load the assembly, doing "from System.Windows.Forms import Application" to get at the Application class so I can do Application.Run(myform), and by adding the location of my little UI dll to the python path and importing classes I need from there.  </div>

<div><br></div><div>  I can also happily do all this after building everything into an exe via pyinstaller.  I did have to jump thru a few pyinstaller hoops to add my little dll to the package pyinstaller builds as well as Python.Runtime.dll.  The path to the location where those are added is appended to pythonpath auto-magically by pyinstaller so they're found just fine.</div>

<div><br></div><div>  So then I found that I needed to get at System.ComponentModel.BindingList and System.Drawing.Bitmap.  I thought all I'd have to do would be "clr.AddReference('System')" and "clr.AddReference('System.Drawing')" and then import BindingList from System.ComponentModel and Bitmap from System.Drawing.  This worked fine when running from pure python but was unhappy running from the pyinstaller-built exe.  In the exe it complains that it can't import BindingList (or Bitmap if I comment out BindingList).  I can make it work in the exe if I use a direct import instead of a 'from' style import.  So if I do "import System.ComponentModel.BindingList" instead of "from System.ComponentModel import BindingList" it works.  However I don't think I should have to do a direct import and doing so gives me problems in the pure python world.</div>

<div><br></div><div>  I actually don't even understand how the System.Windows.Forms assembly is found in the exe scenario.  I don't add the System.Windows.Forms.dll to the package that pyinstaller builds and yet it works just fine which implies that it is being found elsewhere but I don't understand how (nor why it doesn't find the other assemblies that I also want).</div>

<div><br></div><div>  Sorry for the long email.  Hopefully you have some insight.  Hopefully you know what pyinstaller is so that the majority of this email makes some sense =p</div><div><br></div><div>
Thanks for any leads you can provide,</div><div>Jeremy</div><div><br></div></div>
</div><br></div>