From awareman at gmail.com Wed Dec 1 16:45:11 2010 From: awareman at gmail.com (AwareMan) Date: Wed, 1 Dec 2010 16:45:11 +0100 Subject: [Python.NET] [Python.Net] AcquireLock deadlock while calling Python from C# Message-ID: Hi, As Python offers better scientific computing libraries, I wish to reate a bridge between Python and C#. Numpy and matplotlib being some modules needed, I choosed Python.Net rather than IronPython in order to make this work (I'm aware of the existence of IronClad, but unfortunately it seems not to be fully compatible with matplotlib and numpy...). Using Python.Net, I've been quite quickly able to launch Python scripts with parameters, and get back script outputs in C#. That's pretty amazing, and before poiting out my problem, I'd like to thank all the Python.Net staff, that's a really nice project :) Now, let's talk dirty: my problem is as I said I'm able to launch python script, but this can happen only once. I am using AcquireLock and ReleaseLock as explained on various websites, but AcquireLock returns in IntPtr containing "0" (is it a bug ?), and on the second call to AcquireLock, that's it baby, a deadlock :( PythonEngine.Initialize() has been previously called, and is called only once. I'm using .Net 2.0, and this issue looks exactly like this onethat is 4 years old *sic* Below, the piece of code called twice. IntPtr gs = PythonEngine.AcquireLock(); > try > { > PyObject module = PythonEngine.ImportModule(moduleName); > PyObject method = module.GetAttr("Invoke"); > PyObject[] items = new PyObject[parameters.Length]; > for (int i = 0; i < parameters.Length; ++i) > items[i] = ToPython(parameters[i]); > > PyObject pythonReturnValue = method.Invoke(new > PyTuple(items)); > > Object[] result; > if (pythonReturnValue.Length() > 0) > { > result = new Object[pythonReturnValue.Length()]; > for (int i = 0; i < pythonReturnValue.Length(); ++i) > result[i] = > pythonReturnValue.GetItem(i).AsManagedObject(typeof(double)); > } > else > { > result = new Object[1]; > result[0] = > pythonReturnValue.AsManagedObject(typeof(double)); > } > > module.Dispose(); > pythonReturnValue.Dispose(); > foreach (PyObject item in items) > item.Dispose(); > > return result; > } > finally > { > PythonEngine.ReleaseLock(gs); > } > Is there something I may have done wrong ? Thanks for your help, Julien -------------- next part -------------- An HTML attachment was scrubbed... URL: From Alla.Gofman at sandisk.com Wed Dec 1 16:48:31 2010 From: Alla.Gofman at sandisk.com (Alla Gofman) Date: Wed, 1 Dec 2010 17:48:31 +0200 Subject: [Python.NET] Python for .NET installation problem Message-ID: <8DD31B7980DDC049958BD1E459F31ECA2CD041BE77@KFAEXMIPV1.sdcorp.global.sandisk.com> Hi, I have installed Python v. 264 on Win7 and I want to install Python for .NET. I downloaded pythonnet-2.0-alpha2-clr2.0_py26 but there is no python.exe file there. So I downloaded pythonnet-2.0-alpha2-clr2.0_py25 where file indeed exists. I follow the instruction for installation on http://pythonnet.sourceforge.net/readme.html#installation "The source release is a self-contained "private" assembly. Just unzip the package wherever you want it, cd to that directory and run python.exe to start using it." I run python.exe and I get an error: Unhandled Exception: System.DllNotFoundException: Unable to load DLL 'python25': The specified module could not be found. (Exception from HRESULT: 0x8007007E) at Python.Runtime.Runtime.Py_Initialize() at Python.Runtime.Runtime.Initialize() at Python.Runtime.PythonEngine.Initialize() at Python.Runtime.PythonConsole.Main(String[] args) Am I doing something wrong? Thanks. AllaG ________________________________ PLEASE NOTE: The information contained in this electronic mail message is intended only for the use of the designated recipient(s) named above. If the reader of this message is not the intended recipient, you are hereby notified that you have received this message in error and that any review, dissemination, distribution, or copying of this message is strictly prohibited. If you have received this communication in error, please notify the sender by telephone or e-mail (as shown above) immediately and destroy any and all copies of this message in your possession (whether hard copies or electronically stored copies). -------------- next part -------------- An HTML attachment was scrubbed... URL: From julien.faixo at gmail.com Wed Dec 1 15:16:10 2010 From: julien.faixo at gmail.com (Julien faixo) Date: Wed, 1 Dec 2010 15:16:10 +0100 Subject: [Python.NET] [Python.Net] AcquireLock deadlock while calling Python from C# Message-ID: Hi, As Python offers better scientific computing libraries, I wish to reate a bridge between Python and C#. Numpy and matplotlib being some modules needed, I choosed Python.Net rather than IronPython in order to make this work (I'm aware of the existence of IronClad, but unfortunately it seems not to be fully compatible with matplotlib and numpy...). Using Python.Net, I've been quite quickly able to launch Python scripts with parameters, and get back script outputs in C#. That's pretty amazing, and before poiting out my problem, I'd like to thank all the Python.Net staff, that's a really nice project :) Now, let's talk dirty: my problem is as I said I'm able to launch python script, but this can happen only once. I am using AcquireLock and ReleaseLock as explained on various websites, but AcquireLock returns in IntPtr containing "0" (is it a bug ?), and on the second call to AcquireLock, that's it baby, a deadlock :( PythonEngine.Initialize() has been previously called, and is called only once. I'm using .Net 2.0, and this issue looks exactly like this onethat is 4 years old *sic* Below, the piece of code called twice. IntPtr gs = PythonEngine.AcquireLock(); > try > { > PyObject module = PythonEngine.ImportModule(moduleName); > PyObject method = module.GetAttr("Invoke"); > PyObject[] items = new PyObject[parameters.Length]; > for (int i = 0; i < parameters.Length; ++i) > items[i] = ToPython(parameters[i]); > > PyObject pythonReturnValue = method.Invoke(new > PyTuple(items)); > > Object[] result; > if (pythonReturnValue.Length() > 0) > { > result = new Object[pythonReturnValue.Length()]; > for (int i = 0; i < pythonReturnValue.Length(); ++i) > result[i] = > pythonReturnValue.GetItem(i).AsManagedObject(typeof(double)); > } > else > { > result = new Object[1]; > result[0] = > pythonReturnValue.AsManagedObject(typeof(double)); > } > > module.Dispose(); > pythonReturnValue.Dispose(); > foreach (PyObject item in items) > item.Dispose(); > > return result; > } > finally > { > PythonEngine.ReleaseLock(gs); > } > Is there something I may have done wrong ? Thanks for your help, Julien -------------- next part -------------- An HTML attachment was scrubbed... URL: From brian.d.lloyd at gmail.com Wed Dec 1 20:58:41 2010 From: brian.d.lloyd at gmail.com (Brian Lloyd) Date: Wed, 1 Dec 2010 14:58:41 -0500 Subject: [Python.NET] Python for .NET installation problem In-Reply-To: <8DD31B7980DDC049958BD1E459F31ECA2CD041BE77@KFAEXMIPV1.sdcorp.global.sandisk.com> References: <8DD31B7980DDC049958BD1E459F31ECA2CD041BE77@KFAEXMIPV1.sdcorp.global.sandisk.com> Message-ID: Well, the _py25 version will only work if you have python 2.5 installed. Not sure why the _py26 distribution does not include the python.exe. Is anyone who worked on that still tracking the list? On Wed, Dec 1, 2010 at 10:48 AM, Alla Gofman wrote: > Hi, > > I have installed Python v. 264 on Win7 and I want to install Python for > .NET. > > I downloaded pythonnet-2.0-alpha2-clr2.0_py26 but there is no python.exe > file there. > > So I downloaded pythonnet-2.0-alpha2-clr2.0_py25 where file indeed exists. > > > > I follow the instruction for installation on > http://pythonnet.sourceforge.net/readme.html#installation > > > > ?The source release is a self-contained "private" assembly. Just unzip the > package wherever you want it, cd to that directory and run python.exe to > start using it.? > > I run python.exe and I get an error: > > Unhandled Exception: System.DllNotFoundException: Unable to load DLL > 'python25': > > The specified module could not be found. (Exception from HRESULT: > 0x8007007E) > > at Python.Runtime.Runtime.Py_Initialize() > > at Python.Runtime.Runtime.Initialize() > > at Python.Runtime.PythonEngine.Initialize() > > at Python.Runtime.PythonConsole.Main(String[] args) > > > > Am I doing something wrong? > > > > Thanks. > > AllaG > > -- Brian Lloyd http://livingsocial.com (c) 540.845.2975 -------------- next part -------------- An HTML attachment was scrubbed... URL: From Alla.Gofman at sandisk.com Wed Dec 1 23:32:53 2010 From: Alla.Gofman at sandisk.com (Alla Gofman) Date: Thu, 2 Dec 2010 00:32:53 +0200 Subject: [Python.NET] Python for .NET installation problem In-Reply-To: References: <8DD31B7980DDC049958BD1E459F31ECA2CD041BE77@KFAEXMIPV1.sdcorp.global.sandisk.com>, Message-ID: <8DD31B7980DDC049958BD1E459F31ECA2CD0402F0F@KFAEXMIPV1.sdcorp.global.sandisk.com> Thank you for your reply. I checked and py25 version does work with python 2.5 installed. AllaG ________________________________ From: Brian Lloyd [brian.d.lloyd at gmail.com] Sent: Wednesday, December 01, 2010 9:58 PM To: Alla Gofman Cc: pythondotnet at python.org Subject: Re: [Python.NET] Python for .NET installation problem Well, the _py25 version will only work if you have python 2.5 installed. Not sure why the _py26 distribution does not include the python.exe. Is anyone who worked on that still tracking the list? On Wed, Dec 1, 2010 at 10:48 AM, Alla Gofman > wrote: Hi, I have installed Python v. 264 on Win7 and I want to install Python for .NET. I downloaded pythonnet-2.0-alpha2-clr2.0_py26 but there is no python.exe file there. So I downloaded pythonnet-2.0-alpha2-clr2.0_py25 where file indeed exists. I follow the instruction for installation on http://pythonnet.sourceforge.net/readme.html#installation ?The source release is a self-contained "private" assembly. Just unzip the package wherever you want it, cd to that directory and run python.exe to start using it.? I run python.exe and I get an error: Unhandled Exception: System.DllNotFoundException: Unable to load DLL 'python25': The specified module could not be found. (Exception from HRESULT: 0x8007007E) at Python.Runtime.Runtime.Py_Initialize() at Python.Runtime.Runtime.Initialize() at Python.Runtime.PythonEngine.Initialize() at Python.Runtime.PythonConsole.Main(String[] args) Am I doing something wrong? Thanks. AllaG -- Brian Lloyd http://livingsocial.com (c) 540.845.2975 ________________________________ PLEASE NOTE: The information contained in this electronic mail message is intended only for the use of the designated recipient(s) named above. If the reader of this message is not the intended recipient, you are hereby notified that you have received this message in error and that any review, dissemination, distribution, or copying of this message is strictly prohibited. If you have received this communication in error, please notify the sender by telephone or e-mail (as shown above) immediately and destroy any and all copies of this message in your possession (whether hard copies or electronically stored copies). -------------- next part -------------- An HTML attachment was scrubbed... URL: From urs.fleisch at gmail.com Thu Dec 2 08:09:16 2010 From: urs.fleisch at gmail.com (Urs Fleisch) Date: Thu, 2 Dec 2010 08:09:16 +0100 Subject: [Python.NET] Python for .NET installation problem In-Reply-To: <8DD31B7980DDC049958BD1E459F31ECA2CD0402F0F@KFAEXMIPV1.sdcorp.global.sandisk.com> References: <8DD31B7980DDC049958BD1E459F31ECA2CD041BE77@KFAEXMIPV1.sdcorp.global.sandisk.com> <8DD31B7980DDC049958BD1E459F31ECA2CD0402F0F@KFAEXMIPV1.sdcorp.global.sandisk.com> Message-ID: Get the current source code from Subversion. Then build a Release version of pythonnet.sln and make sure that PYTHON26 is defined instead of PYTHON25, which should be the case for the latest code in Subversion. You can then copy clr.pyd and Python.Runtime.dll to C:\Python26. You do not really need the generated python.exe, you can use the standard python interpreter and import clr to use Python for .NET. -Urs From awareman at gmail.com Fri Dec 3 10:46:28 2010 From: awareman at gmail.com (AwareMan) Date: Fri, 3 Dec 2010 10:46:28 +0100 Subject: [Python.NET] [Python.Net] AcquireLock deadlock while calling Python from C# Message-ID: Hi, sorry for the two posts, i was not sure if the mailing list server would let the first one be sent as this address wasn't registered :x I finally managed to solve the issue, and I'm a bit ashamed of the trivialness of the solution but well, it may help someone someday. The difference between the two executions was that as calculation is higly parallelized, the BeginAllowThread() method had to be called at start... Thought that using AcquireLock and ReleaseLock would be enough in order to ensure thread safety, but that's not the case. Also, EndAllowThread has to be called when stopping to use the PythonEngine, not on a perrequest basis. Now, this is working just great :) Best regards, Julien -------------- next part -------------- An HTML attachment was scrubbed... URL: From Alla.Gofman at sandisk.com Sun Dec 5 10:19:21 2010 From: Alla.Gofman at sandisk.com (Alla Gofman) Date: Sun, 5 Dec 2010 11:19:21 +0200 Subject: [Python.NET] Python for .NET installation problem In-Reply-To: <4CF8A4CC.7060607@BCDesignsWell.com> References: <8DD31B7980DDC049958BD1E459F31ECA2CD041BE77@KFAEXMIPV1.sdcorp.global.sandisk.com> <4CF8A4CC.7060607@BCDesignsWell.com> Message-ID: <8DD31B7980DDC049958BD1E459F31ECA2CD04AD7F7@KFAEXMIPV1.sdcorp.global.sandisk.com> Hi Barton, Thanks. I also have build a Release version of pythonnet.sln. However, I ran into some trouble, Python.exe didn't launched. I get the same error as before for both python25 and 26 when I run my program and pythonnet.sln. I don't understand how can I use python.exe I want to run C# which embedding Phyton without installing Python full version on PC. Can I do so? Alla. From: Barton [mailto:barton at bcdesignswell.com] Sent: Friday, December 03, 2010 10:06 AM To: Alla Gofman Subject: Re: [Python.NET] Python for .NET installation problem Hi, alla, I'll push these to the project in a bit. I did goof on the last round. Cheers, Barton On 12/1/2010 7:48 AM, Alla Gofman wrote: Hi, I have installed Python v. 264 on Win7 and I want to install Python for .NET. I downloaded pythonnet-2.0-alpha2-clr2.0_py26 but there is no python.exe file there. So I downloaded pythonnet-2.0-alpha2-clr2.0_py25 where file indeed exists. I follow the instruction for installation on http://pythonnet.sourceforge.net/readme.html#installation "The source release is a self-contained "private" assembly. Just unzip the package wherever you want it, cd to that directory and run python.exe to start using it." I run python.exe and I get an error: Unhandled Exception: System.DllNotFoundException: Unable to load DLL 'python25': The specified module could not be found. (Exception from HRESULT: 0x8007007E) at Python.Runtime.Runtime.Py_Initialize() at Python.Runtime.Runtime.Initialize() at Python.Runtime.PythonEngine.Initialize() at Python.Runtime.PythonConsole.Main(String[] args) Am I doing something wrong? Thanks. AllaG ________________________________ PLEASE NOTE: The information contained in this electronic mail message is intended only for the use of the designated recipient(s) named above. If the reader of this message is not the intended recipient, you are hereby notified that you have received this message in error and that any review, dissemination, distribution, or copying of this message is strictly prohibited. If you have received this communication in error, please notify the sender by telephone or e-mail (as shown above) immediately and destroy any and all copies of this message in your possession (whether hard copies or electronically stored copies). _________________________________________________ Python.NET mailing list - PythonDotNet at python.org http://mail.python.org/mailman/listinfo/pythondotnet -------------- next part -------------- An HTML attachment was scrubbed... URL: From davidgshi at yahoo.co.uk Mon Dec 6 22:48:03 2010 From: davidgshi at yahoo.co.uk (David Shi) Date: Mon, 6 Dec 2010 21:48:03 +0000 (GMT) Subject: [Python.NET] A system designer and Python expert in London is available for a new job and challenge In-Reply-To: <8DD31B7980DDC049958BD1E459F31ECA2CD04AD7F7@KFAEXMIPV1.sdcorp.global.sandisk.com> References: <8DD31B7980DDC049958BD1E459F31ECA2CD041BE77@KFAEXMIPV1.sdcorp.global.sandisk.com> <4CF8A4CC.7060607@BCDesignsWell.com> <8DD31B7980DDC049958BD1E459F31ECA2CD04AD7F7@KFAEXMIPV1.sdcorp.global.sandisk.com> Message-ID: <404545.60536.qm@web26308.mail.ukl.yahoo.com> I am a system architect and Python expert in London area. I am now available for a new job, project and challenge. In addition, I have start up and IT human resource management work experience. If any organisation is interested in setting up a company in London, please do not hesitate to contact me. Regards. David 0044(0)7881434612 -------------- next part -------------- An HTML attachment was scrubbed... URL: From laszlo.sebo at primefocusworld.com Tue Dec 7 02:22:02 2010 From: laszlo.sebo at primefocusworld.com (Laszlo Sebo) Date: Mon, 06 Dec 2010 17:22:02 -0800 Subject: [Python.NET] building on linux, mono 2.8.1 Message-ID: <4CFD8C3A.4060206@primefocusworld.com> An HTML attachment was scrubbed... URL: From laszlo.sebo at primefocusworld.com Wed Dec 8 04:08:51 2010 From: laszlo.sebo at primefocusworld.com (Laszlo Sebo) Date: Tue, 07 Dec 2010 19:08:51 -0800 Subject: [Python.NET] building on linux, mono 2.8.1 In-Reply-To: <4CFD8C3A.4060206@primefocusworld.com> References: <4CFD8C3A.4060206@primefocusworld.com> Message-ID: <4CFEF6C3.6030908@primefocusworld.com> An HTML attachment was scrubbed... URL: From laszlo.sebo at primefocusworld.com Wed Dec 8 22:35:01 2010 From: laszlo.sebo at primefocusworld.com (Laszlo Sebo) Date: Wed, 08 Dec 2010 13:35:01 -0800 Subject: [Python.NET] building on linux, mono 2.8.1 In-Reply-To: <4CFEF6C3.6030908@primefocusworld.com> References: <4CFD8C3A.4060206@primefocusworld.com> <4CFEF6C3.6030908@primefocusworld.com> Message-ID: <4CFFFA05.8080008@primefocusworld.com> An HTML attachment was scrubbed... URL: From laszlo.sebo at primefocusworld.com Thu Dec 9 02:44:45 2010 From: laszlo.sebo at primefocusworld.com (Laszlo Sebo) Date: Wed, 08 Dec 2010 17:44:45 -0800 Subject: [Python.NET] building on linux, mono 2.8.1 In-Reply-To: <4CFFFA05.8080008@primefocusworld.com> References: <4CFD8C3A.4060206@primefocusworld.com> <4CFEF6C3.6030908@primefocusworld.com> <4CFFFA05.8080008@primefocusworld.com> Message-ID: <4D00348D.8090904@primefocusworld.com> An HTML attachment was scrubbed... URL: From btribble at ea.com Thu Dec 9 04:47:12 2010 From: btribble at ea.com (Tribble, Brett) Date: Wed, 8 Dec 2010 19:47:12 -0800 Subject: [Python.NET] building on linux, mono 2.8.1 In-Reply-To: <4D00348D.8090904@primefocusworld.com> References: <4CFD8C3A.4060206@primefocusworld.com> <4CFEF6C3.6030908@primefocusworld.com> <4CFFFA05.8080008@primefocusworld.com> <4D00348D.8090904@primefocusworld.com> Message-ID: Your long self-conversation is the most interesting thing to happen to this list in a long time... From: pythondotnet-bounces+btribble=ea.com at python.org [mailto:pythondotnet-bounces+btribble=ea.com at python.org] On Behalf Of Laszlo Sebo Sent: Wednesday, December 08, 2010 5:45 PM To: pythondotnet at python.org Subject: Re: [Python.NET] building on linux, mono 2.8.1 At the risk of having a long conversation here with myself... :) It appears that the crash happens in intobject.c of python, at the PyObject *PyInt_FromLong(long ival) function, when it tries to increment the reference counter: Py_INCREF(v); When python.net calls this function first, it calls it with the value of 0, which falls into a special handled range of integers that are dealt with in a small_ints[] array. However, that array never go initialized, so the reference counter crashes. The array would normally be initialized by calling _PyInt_Init(void). Sooo... just to test my theory, i exposed that function and called it explicitly from Python.Runtime.Initialize() and low and behold, import clr now works just fine! So i'll now go on a hunt, and make sure everything is initialized properly, i'm guessing some main init function isn't being called somewhere when using python.net from an embedded python. cheers, laszlo On 08/12/2010 1:35 PM, Laszlo Sebo wrote: Made a little bit of progress, but am now back to square one.. :) Basically, seems that the python embedded in nuke uses UCS4 instead of UCS2 which is the default when building python. So the python so's i had were using UCS2 while Nuke's internal python was using UCS4. I rebuilt python using the --enable-unicode=ucs4 flag, then rebuilt python.net. I hit another wall fairly soon, the mono config (dll remap) file wasn't being initialized, so i would be getting missing msvcrt dll errors on import clr. To fix that, i had to uncomment this line in pynetinit.c: //mono_config_parse(NULL); However, now i am back to the previous error i had: Stacktrace: at (wrapper managed-to-native) Python.Runtime.Runtime.PyInt_FromLong (intptr) <0x00060> at (wrapper managed-to-native) Python.Runtime.Runtime.PyInt_FromLong (intptr) <0xffffffff> at Python.Runtime.Runtime.PyInt_FromInt32 (int) <0x0006b> at Python.Runtime.Runtime.Initialize () <0x00433> at Python.Runtime.PythonEngine.Initialize () <0x00073> at (wrapper runtime-invoke) object.runtime_invoke_void (object,intptr,intptr,intptr) <0xffffffff> oh well... anybody managed to get python.net working with UCS4 python? cheers, laszlo -------------- next part -------------- An HTML attachment was scrubbed... URL: From lists at cheimes.de Thu Dec 9 06:23:22 2010 From: lists at cheimes.de (Christian Heimes) Date: Thu, 09 Dec 2010 06:23:22 +0100 Subject: [Python.NET] building on linux, mono 2.8.1 In-Reply-To: <4D00348D.8090904@primefocusworld.com> References: <4CFD8C3A.4060206@primefocusworld.com> <4CFEF6C3.6030908@primefocusworld.com> <4CFFFA05.8080008@primefocusworld.com> <4D00348D.8090904@primefocusworld.com> Message-ID: Am 09.12.2010 02:44, schrieb Laszlo Sebo: > The array would normally be initialized by calling _PyInt_Init(void). Sooo... > just to test my theory, i exposed that function and called it explicitly from > Python.Runtime.Initialize() and low and behold, import clr now works just fine! > > So i'll now go on a hunt, and make sure everything is initialized properly, i'm > guessing some main init function isn't being called somewhere when using > python.net from an embedded python. This happens when you use a "python" binary that isn't linked against libpython*.so. For example Debian and Ubuntu build a shared library but the python exe is statically linked against libpython.a. I hit the same bug when I coded the initial port to Mono about three years ago. Try "ldd $(which python2.6) | grep libpython". If it doesn't show the Python shared library then you have to create your own binary. A statically typed exe calls only _PyInt_Init() in its own data segment. "import clr" loads the shared library which doesn't anything with the exe. You end up with two interpreters in one program. This should be documented in the Python.NET sources somewhere. The sources should also contain an example or Makefile that creates a dynamically linked python binary for you. Python 2.5 support on Linux with UCS4 used to be stable and mature, since it was my major testing and deployment platform. But the current state of Python.NET on Linux is ... well ... not so good. ;) Christian From laszlo.sebo at primefocusworld.com Thu Dec 9 21:00:18 2010 From: laszlo.sebo at primefocusworld.com (Laszlo Sebo) Date: Thu, 09 Dec 2010 12:00:18 -0800 Subject: [Python.NET] building on linux, mono 2.8.1 In-Reply-To: References: <4CFD8C3A.4060206@primefocusworld.com> <4CFEF6C3.6030908@primefocusworld.com> <4CFFFA05.8080008@primefocusworld.com> <4D00348D.8090904@primefocusworld.com> Message-ID: <4D013552.9090806@primefocusworld.com> An HTML attachment was scrubbed... URL: From laszlo.sebo at primefocusworld.com Thu Dec 9 21:05:40 2010 From: laszlo.sebo at primefocusworld.com (Laszlo Sebo) Date: Thu, 09 Dec 2010 12:05:40 -0800 Subject: [Python.NET] building on linux, mono 2.8.1 In-Reply-To: <4D013552.9090806@primefocusworld.com> References: <4CFD8C3A.4060206@primefocusworld.com> <4CFEF6C3.6030908@primefocusworld.com> <4CFFFA05.8080008@primefocusworld.com> <4D00348D.8090904@primefocusworld.com> <4D013552.9090806@primefocusworld.com> Message-ID: <4D013694.7050205@primefocusworld.com> > Sadly, our other target, Maya, seems to be linking python statically... So I hope i can figure out how to get this integrated somehow... Actually, scratch that. It seems like it has it's own .so as well. Time for some testing.... cheers, laszlo From dirk.krause at pixelpark.com Thu Dec 9 21:11:27 2010 From: dirk.krause at pixelpark.com (Dirk Krause) Date: Thu, 9 Dec 2010 21:11:27 +0100 Subject: [Python.NET] building on linux, mono 2.8.1 In-Reply-To: <4D013552.9090806@primefocusworld.com> References: <4CFD8C3A.4060206@primefocusworld.com> <4CFEF6C3.6030908@primefocusworld.com> <4CFFFA05.8080008@primefocusworld.com><4D00348D.8090904@primefocusworld.com> <4D013552.9090806@primefocusworld.com> Message-ID: <6C2AFDB53CBC0D4A8637CF3C7B63B2B886F0EC@postbox.bitlab.de> I'll chime in with a quick comment on this: I evaluated python.net some time ago (for an OpenSimulator based project some time ago) and it worked like a charm. Unfortunately we had to stop this project for various reasons, but I have to say: it's projects like these that keep the fun going. Great work, guys!! Best, Dirk Von: pythondotnet-bounces+dirk.krause=pixelpark.com at python.org [mailto:pythondotnet-bounces+dirk.krause=pixelpark.com at python.org] Im Auftrag von Laszlo Sebo Gesendet: Donnerstag, 9. Dezember 2010 21:00 An: pythondotnet at python.org Betreff: Re: [Python.NET] building on linux, mono 2.8.1 Not a lot of traffic lately, eh? :-) In all honesty, i think python.net is a godsend. We have been using it as a core part of our pipeline for a long time now. It enables us full .net integration into a lot of tools that have python embedded in them. It allowed us to write most of our pipeline code in c# and fully reuse it in several different applications with practically no change. We are now working on integrating linux into our pipeline, so it's crucial for us to get this working, if possible :-) In the meantime, i have found that one of our target client applications (Nuke), has it's own libpython.so and if i link to that, all seems to work just dandy! Huge relief! Sadly, our other target, Maya, seems to be linking python statically... So I hope i can figure out how to get this integrated somehow... cheers, laszlo On 08/12/2010 7:47 PM, Tribble, Brett wrote: Your long self-conversation is the most interesting thing to happen to this list in a long time... -------------- next part -------------- An HTML attachment was scrubbed... URL: From btribble at ea.com Fri Dec 10 04:54:17 2010 From: btribble at ea.com (Tribble, Brett) Date: Thu, 9 Dec 2010 19:54:17 -0800 Subject: [Python.NET] building on linux, mono 2.8.1 In-Reply-To: <4D013694.7050205@primefocusworld.com> References: <4CFD8C3A.4060206@primefocusworld.com> <4CFEF6C3.6030908@primefocusworld.com> <4CFFFA05.8080008@primefocusworld.com> <4D00348D.8090904@primefocusworld.com> <4D013552.9090806@primefocusworld.com> <4D013694.7050205@primefocusworld.com> Message-ID: Maya works fine with python.net. We use it all the time. Just remember that Maya is very particular as to how it handles multithreading, raising events, and the like. There is some info in the Maya Python SDK regarding how to deal with Python threading and Maya, and it seems to work with .NET callbacks as well. I've found that is seems best to add a flag to your .NET assembly that enables/disable events so that you can shut them off quickly before you end up with stacked event callbacks and resulting Maya crashes. If you're not raising events that percolate into Maya, then you probably don't need to worry about this. -----Original Message----- From: pythondotnet-bounces+btribble=ea.com at python.org [mailto:pythondotnet-bounces+btribble=ea.com at python.org] On Behalf Of Laszlo Sebo Sent: Thursday, December 09, 2010 12:06 PM To: pythondotnet at python.org Subject: Re: [Python.NET] building on linux, mono 2.8.1 > Sadly, our other target, Maya, seems to be linking python statically... So I hope i can figure out how to get this integrated somehow... Actually, scratch that. It seems like it has it's own .so as well. Time for some testing.... cheers, laszlo _________________________________________________ Python.NET mailing list - PythonDotNet at python.org http://mail.python.org/mailman/listinfo/pythondotnet From laszlo.sebo at primefocusworld.com Fri Dec 10 19:30:12 2010 From: laszlo.sebo at primefocusworld.com (Laszlo Sebo) Date: Fri, 10 Dec 2010 10:30:12 -0800 Subject: [Python.NET] building on linux, mono 2.8.1 In-Reply-To: References: <4CFD8C3A.4060206@primefocusworld.com> <4CFEF6C3.6030908@primefocusworld.com> <4CFFFA05.8080008@primefocusworld.com> <4D00348D.8090904@primefocusworld.com> <4D013552.9090806@primefocusworld.com> <4D013694.7050205@primefocusworld.com> Message-ID: <4D0271B4.3090000@primefocusworld.com> We have been using it in maya on windows as well for a long time actually. We do have some event calling mechanisms as all of our custom GUI is implemented in the .net assemblies, and they communice with maya using some event hooks & delegate functions. It seems to work well, as long as we are careful. In the meantime, i got python.net working with the latest version of mono (2.8.1). Do you guys mind if i check in some minor changes to the source? I could post an svn patch here first. cheers, laszlo On 09/12/2010 7:54 PM, Tribble, Brett wrote: > Maya works fine with python.net. We use it all the time. Just remember that Maya is very particular as to how it handles multithreading, raising events, and the like. There is some info in the Maya Python SDK regarding how to deal with Python threading and Maya, and it seems to work with .NET callbacks as well. I've found that is seems best to add a flag to your .NET assembly that enables/disable events so that you can shut them off quickly before you end up with stacked event callbacks and resulting Maya crashes. If you're not raising events that percolate into Maya, then you probably don't need to worry about this. > > > -----Original Message----- > From: pythondotnet-bounces+btribble=ea.com at python.org [mailto:pythondotnet-bounces+btribble=ea.com at python.org] On Behalf Of Laszlo Sebo > Sent: Thursday, December 09, 2010 12:06 PM > To: pythondotnet at python.org > Subject: Re: [Python.NET] building on linux, mono 2.8.1 > > > Sadly, our other target, Maya, seems to be linking python > statically... So I hope i can figure out how to get this integrated > somehow... > > Actually, scratch that. It seems like it has it's own .so as well. Time > for some testing.... > > > > cheers, > laszlo > > _________________________________________________ > Python.NET mailing list - PythonDotNet at python.org > http://mail.python.org/mailman/listinfo/pythondotnet > From brian.d.lloyd at gmail.com Sun Dec 12 07:25:10 2010 From: brian.d.lloyd at gmail.com (Brian Lloyd) Date: Sun, 12 Dec 2010 01:25:10 -0500 Subject: [Python.NET] building on linux, mono 2.8.1 In-Reply-To: <4D0271B4.3090000@primefocusworld.com> References: <4CFD8C3A.4060206@primefocusworld.com> <4CFEF6C3.6030908@primefocusworld.com> <4CFFFA05.8080008@primefocusworld.com> <4D00348D.8090904@primefocusworld.com> <4D013552.9090806@primefocusworld.com> <4D013694.7050205@primefocusworld.com> <4D0271B4.3090000@primefocusworld.com> Message-ID: Hi all - I've recently taken a position that is MUCH more open-source friendly. Now that I don't have to have lawyers parse everything, what do you think about moving this whole thing to github? I don't know that I'll have much more time to devote to the project near term, but I would really like to lower the barrier-to-entry for folks with a vested interest in this project to contribute (and divest myself and others of of managing the SF project). Unless anyone objects I think we should migrate the repo to github and redirect SF there... Thoughts? - Brian On Fri, Dec 10, 2010 at 1:30 PM, Laszlo Sebo < laszlo.sebo at primefocusworld.com> wrote: > We have been using it in maya on windows as well for a long time actually. > We do have some event calling mechanisms as all of our custom GUI is > implemented in the .net assemblies, and they communice with maya using some > event hooks & delegate functions. > > It seems to work well, as long as we are careful. > > In the meantime, i got python.net working with the latest version of mono > (2.8.1). Do you guys mind if i check in some minor changes to the source? I > could post an svn patch here first. > > > cheers, > laszlo > > > > > On 09/12/2010 7:54 PM, Tribble, Brett wrote: > >> Maya works fine with python.net. We use it all the time. Just remember >> that Maya is very particular as to how it handles multithreading, raising >> events, and the like. There is some info in the Maya Python SDK regarding >> how to deal with Python threading and Maya, and it seems to work with .NET >> callbacks as well. I've found that is seems best to add a flag to your .NET >> assembly that enables/disable events so that you can shut them off quickly >> before you end up with stacked event callbacks and resulting Maya crashes. >> If you're not raising events that percolate into Maya, then you probably >> don't need to worry about this. >> >> >> -----Original Message----- >> From: pythondotnet-bounces+btribble=ea.com at python.org [mailto: >> pythondotnet-bounces+btribble =ea.com@ >> python.org] On Behalf Of Laszlo Sebo >> Sent: Thursday, December 09, 2010 12:06 PM >> To: pythondotnet at python.org >> Subject: Re: [Python.NET] building on linux, mono 2.8.1 >> >> > Sadly, our other target, Maya, seems to be linking python >> statically... So I hope i can figure out how to get this integrated >> somehow... >> >> Actually, scratch that. It seems like it has it's own .so as well. Time >> for some testing.... >> >> >> >> cheers, >> laszlo >> >> _________________________________________________ >> Python.NET mailing list - PythonDotNet at python.org >> http://mail.python.org/mailman/listinfo/pythondotnet >> >> > _________________________________________________ > Python.NET mailing list - PythonDotNet at python.org > http://mail.python.org/mailman/listinfo/pythondotnet > -- Brian Lloyd http://livingsocial.com (c) 540.845.2975 -------------- next part -------------- An HTML attachment was scrubbed... URL: From lists at cheimes.de Mon Dec 13 18:32:18 2010 From: lists at cheimes.de (Christian Heimes) Date: Mon, 13 Dec 2010 18:32:18 +0100 Subject: [Python.NET] building on linux, mono 2.8.1 In-Reply-To: References: <4CFD8C3A.4060206@primefocusworld.com> <4CFEF6C3.6030908@primefocusworld.com> <4CFFFA05.8080008@primefocusworld.com> <4D00348D.8090904@primefocusworld.com> <4D013552.9090806@primefocusworld.com> <4D013694.7050205@primefocusworld.com> <4D0271B4.3090000@primefocusworld.com> Message-ID: Am 12.12.2010 07:25, schrieb Brian Lloyd: > Hi all - I've recently taken a position that is MUCH more open-source > friendly. Now that I don't > have to have lawyers parse everything, what do you think about moving this > whole thing to > github? I don't know that I'll have much more time to devote to the project > near term, but I would > really like to lower the barrier-to-entry for folks with a vested interest > in this project to contribute > (and divest myself and others of of managing the SF project). > > Unless anyone objects I think we should migrate the repo to github and > redirect SF there... I'm generally +1 for a DVCS but why git? I prefer to eat my own food and stick to a Python based DVCS like hq. Christian From btribble at ea.com Mon Dec 13 21:15:26 2010 From: btribble at ea.com (Tribble, Brett) Date: Mon, 13 Dec 2010 12:15:26 -0800 Subject: [Python.NET] building on linux, mono 2.8.1 In-Reply-To: References: <4CFD8C3A.4060206@primefocusworld.com> <4CFEF6C3.6030908@primefocusworld.com> <4CFFFA05.8080008@primefocusworld.com> <4D00348D.8090904@primefocusworld.com> <4D013552.9090806@primefocusworld.com> <4D013694.7050205@primefocusworld.com> <4D0271B4.3090000@primefocusworld.com> Message-ID: I'm not a huge GIT lover, but it seems to have the most inertia behind it right now, so that would be my preference should the change be made... -----Original Message----- From: pythondotnet-bounces+btribble=ea.com at python.org [mailto:pythondotnet-bounces+btribble=ea.com at python.org] On Behalf Of Christian Heimes Sent: Monday, December 13, 2010 9:32 AM To: pythondotnet at python.org Subject: Re: [Python.NET] building on linux, mono 2.8.1 Am 12.12.2010 07:25, schrieb Brian Lloyd: > Hi all - I've recently taken a position that is MUCH more open-source > friendly. Now that I don't > have to have lawyers parse everything, what do you think about moving this > whole thing to > github? I don't know that I'll have much more time to devote to the project > near term, but I would > really like to lower the barrier-to-entry for folks with a vested interest > in this project to contribute > (and divest myself and others of of managing the SF project). > > Unless anyone objects I think we should migrate the repo to github and > redirect SF there... I'm generally +1 for a DVCS but why git? I prefer to eat my own food and stick to a Python based DVCS like hq. Christian _________________________________________________ Python.NET mailing list - PythonDotNet at python.org http://mail.python.org/mailman/listinfo/pythondotnet From jason at awbrey.net Wed Dec 15 01:53:01 2010 From: jason at awbrey.net (Jason Awbrey) Date: Tue, 14 Dec 2010 18:53:01 -0600 Subject: [Python.NET] getting started - can't import a simple dll Message-ID: I'm evaluating PDN for use in an upcoming project. 1. installed Python 2.6.5 2. installed PDN - copied the clr.pyd file to Python's DLLs folder, and copied Python.Runtime.dll to Python's root 3. copy my dll (VS2010, simple C# class lib with two methods) into Python's root. 4. start python (using the python.exe from 2.6.5, not the one from PDN) >>> import clr >>> clr.AddReference("My.DLL") Traceback (most recent call last): File "", line 1, in System.IO.FileNotFoundException: Unable to find assembly 'HFF.Helper.Utilities'. at Python.Runtime.CLRModule.AddReference(String name) >>> I assume I'm making some incredibly obvious newbie error. Can anyone point me in the right direction? And, where can I find good docs/reference/discussion on using PDN? thanks - Jason -------------- next part -------------- An HTML attachment was scrubbed... URL: From laszlo.sebo at primefocusworld.com Wed Dec 15 02:21:32 2010 From: laszlo.sebo at primefocusworld.com (Laszlo Sebo) Date: Tue, 14 Dec 2010 17:21:32 -0800 Subject: [Python.NET] getting started - can't import a simple dll In-Reply-To: References: Message-ID: <4D08181C.5060407@primefocusworld.com> An HTML attachment was scrubbed... URL: From jason at awbrey.net Wed Dec 15 02:47:29 2010 From: jason at awbrey.net (Jason Awbrey) Date: Tue, 14 Dec 2010 19:47:29 -0600 Subject: [Python.NET] getting started - can't import a simple dll In-Reply-To: <4D08181C.5060407@primefocusworld.com> References: <4D08181C.5060407@primefocusworld.com> Message-ID: Thanks. I tried creating a test assembly with just a default constructor and no other dependencies, and I get the same error when I try to import it. I also tried setting the path variable, through windows as well as in code, and get the same result. Assuming my dll is named "TestLib.dll", I should be able to do clr.AddReference("TestLib"), correct? Do I have to strong name my assemblies, or put them in the GAC? Or is that optional? Any other suggestions of how to track this down? On Tue, Dec 14, 2010 at 7:21 PM, Laszlo Sebo < laszlo.sebo at primefocusworld.com> wrote: > It appears that some reference dependencies of the My.DLL assembly (the > assembly containing HFF.Helper.Utilities ?) weren't found. > > Make sure that whichever referenced assembly has those classes is > accessible through the path env variables. If needed, you can add it inside > python, by simply doing something like: > > import sys > sys.path.append('place where my dlls are') > > This is probably the best documentation out there: > http://pythonnet.sourceforge.net/readme.html > > But once you get the initial assemblies to work, its fairly straightforward > since you just use the .net classes natively from python. > > > cheers, > laszlo > > > > On 14/12/2010 4:53 PM, Jason Awbrey wrote: > > I'm evaluating PDN for use in an upcoming project. > > 1. installed Python 2.6.5 > 2. installed PDN - copied the clr.pyd file to Python's DLLs folder, and > copied Python.Runtime.dll to Python's root > 3. copy my dll (VS2010, simple C# class lib with two methods) into Python's > root. > 4. start python (using the python.exe from 2.6.5, not the one from PDN) > > >>> import clr > >>> clr.AddReference("My.DLL") > Traceback (most recent call last): > File "", line 1, in > System.IO.FileNotFoundException: Unable to find assembly > 'HFF.Helper.Utilities'. > > at Python.Runtime.CLRModule.AddReference(String name) > >>> > > I assume I'm making some incredibly obvious newbie error. Can anyone > point me in the right direction? > > And, where can I find good docs/reference/discussion on using PDN? > > thanks - Jason > > > > _________________________________________________ > Python.NET mailing list - PythonDotNet at python.org > http://mail.python.org/mailman/listinfo/pythondotnet > -------------- next part -------------- An HTML attachment was scrubbed... URL: From laszlo.sebo at primefocusworld.com Wed Dec 15 03:06:16 2010 From: laszlo.sebo at primefocusworld.com (Laszlo Sebo) Date: Tue, 14 Dec 2010 18:06:16 -0800 Subject: [Python.NET] getting started - can't import a simple dll In-Reply-To: References: <4D08181C.5060407@primefocusworld.com> Message-ID: <4D082298.6020407@primefocusworld.com> When you import the assembly it will be referenced by the assembly name defined in the project settings (which is what the dll will be named as). GAC isn't required ( i never do that ). I just did a quick test here. Made an empty Class project via Visual Studio 2008. Then tweaked the source to add 2 functions: using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace ClassLibrary1 { public class Class1 { public string Function1() { return "Test Function Called"; } public void Function2() { Console.WriteLine("Hello World"); } } } I built it with all default settings (as a class library), then copied the dll to the python / lib / site-packages folder, along with the clr.pyd, Python.Runtime.dll and Python.Runtime.dll.config files Then from python: Python 2.5.2 (r252:60911, Feb 21 2008, 13:11:45) [MSC v.1310 32 bit (Intel win32 Type "help", "copyright", "credits" or "license" for more information. >>> import clr >>> clr.AddReference('ClassLibrary1') >>> import ClassLibrary1 >>> myObject = ClassLibrary1.Class1() >>> myObject.Function1() u'Test Function Called' >>> myObject.Function2() Hello World >>> Note that the "import ClassLibrary1" is the namespace not the assembly (it just happens to be the same since its all default values). I wonder if your issue is somehow related to VS2010? Could it be adding some default references? What references are listed in VS? cheers, laszlo On 14/12/2010 5:47 PM, Jason Awbrey wrote: > Thanks. I tried creating a test assembly with just a default > constructor and no other dependencies, and I get the same error when I > try to import it. > > I also tried setting the path variable, through windows as well as in > code, and get the same result. > > Assuming my dll is named "TestLib.dll", I should be able to do > clr.AddReference("TestLib"), correct? > > Do I have to strong name my assemblies, or put them in the GAC? Or is > that optional? > > Any other suggestions of how to track this down? From jason at awbrey.net Wed Dec 15 03:20:32 2010 From: jason at awbrey.net (Jason Awbrey) Date: Tue, 14 Dec 2010 20:20:32 -0600 Subject: [Python.NET] getting started - can't import a simple dll In-Reply-To: <4D082298.6020407@primefocusworld.com> References: <4D08181C.5060407@primefocusworld.com> <4D082298.6020407@primefocusworld.com> Message-ID: I recompiled using .NET 2.0 and now I can load the DLL. Is there any support for frameworks after 2.0? I'd hate to lose the ability to use LINQ. Also, you mentioned Python.Runtime.dll.config. I don't have this file. What's in it? thanks for your help On Tue, Dec 14, 2010 at 8:06 PM, Laszlo Sebo < laszlo.sebo at primefocusworld.com> wrote: > When you import the assembly it will be referenced by the assembly name > defined in the project settings (which is what the dll will be named as). > GAC isn't required ( i never do that ). > > I just did a quick test here. Made an empty Class project via Visual Studio > 2008. > > Then tweaked the source to add 2 functions: > > using System; > using System.Collections.Generic; > using System.Linq; > using System.Text; > > namespace ClassLibrary1 > { > public class Class1 > { > public string Function1() > { > return "Test Function Called"; > } > public void Function2() > { > Console.WriteLine("Hello World"); > } > } > } > > I built it with all default settings (as a class library), then copied the > dll to the python / lib / site-packages folder, along with the clr.pyd, > Python.Runtime.dll and Python.Runtime.dll.config files > > Then from python: > > Python 2.5.2 (r252:60911, Feb 21 2008, 13:11:45) [MSC v.1310 32 bit (Intel > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>> import clr > >>> clr.AddReference('ClassLibrary1') > > >>> import ClassLibrary1 > >>> myObject = ClassLibrary1.Class1() > >>> myObject.Function1() > u'Test Function Called' > >>> myObject.Function2() > Hello World > >>> > > Note that the "import ClassLibrary1" is the namespace not the assembly (it > just happens to be the same since its all default values). > I wonder if your issue is somehow related to VS2010? Could it be adding > some default references? What references are listed in VS? > > > cheers, > laszlo > > > > > On 14/12/2010 5:47 PM, Jason Awbrey wrote: > >> Thanks. I tried creating a test assembly with just a default constructor >> and no other dependencies, and I get the same error when I try to import it. >> >> I also tried setting the path variable, through windows as well as in >> code, and get the same result. >> >> Assuming my dll is named "TestLib.dll", I should be able to do >> clr.AddReference("TestLib"), correct? >> >> Do I have to strong name my assemblies, or put them in the GAC? Or is >> that optional? >> >> Any other suggestions of how to track this down? >> > > _________________________________________________ > Python.NET mailing list - PythonDotNet at python.org > http://mail.python.org/mailman/listinfo/pythondotnet > -------------- next part -------------- An HTML attachment was scrubbed... URL: From laszlo.sebo at primefocusworld.com Wed Dec 15 05:25:14 2010 From: laszlo.sebo at primefocusworld.com (Laszlo Sebo) Date: Tue, 14 Dec 2010 20:25:14 -0800 Subject: [Python.NET] getting started - can't import a simple dll In-Reply-To: References: <4D08181C.5060407@primefocusworld.com><4D082298.6020407@primefocusworld.com> Message-ID: <8FBD5A8818E74C0E91F138CF9A03B559@Red5> Yeah you don't actually need the .config file, it's just a dll mapping file for use with mono on linux (i've been in linux land for a while, so it must have popped from my subconcious). I believe currently clr 2.x is supported, which means that up to .net 3.5 it should work fine, as those releases still use the 2.0 runtime (someone correct me if i'm wrong). LINQ was added with 3.5, so it should work. cheers, laszlo I recompiled using .NET 2.0 and now I can load the DLL. Is there any support for frameworks after 2.0? I'd hate to lose the ability to use LINQ. Also, you mentioned Python.Runtime.dll.config. I don't have this file. What's in it? -------------- next part -------------- An HTML attachment was scrubbed... URL: From dave.hirschfeld at gmail.com Wed Dec 15 11:09:32 2010 From: dave.hirschfeld at gmail.com (Dave Hirschfeld) Date: Wed, 15 Dec 2010 10:09:32 +0000 (UTC) Subject: [Python.NET] getting started - can't import a simple dll References: <4D08181C.5060407@primefocusworld.com><4D082298.6020407@primefocusworld.com> <8FBD5A8818E74C0E91F138CF9A03B559@Red5> Message-ID: Laszlo Sebo writes: > > ? > I believe currently clr?2.x is supported, > which means that up to .net 3.5 it should work fine, as those releases > still use the 2.0 runtime (someone correct me if i'm wrong). LINQ was added > with 3.5, so it should work. > ? > cheers, > laszlo > ? > I > recompiled using .NET 2.0 and now I can load the DLL.? Is there any > support for frameworks after 2.0?? I'd hate to lose the ability to use > LINQ.Also, you mentioned Python.Runtime.dll.config.? I don't have > this file.? What's in it? > I managed to compile Python.NET for .NET 4 with only a couple of minor modifications to the code: http://thread.gmane.org/gmane.comp.python.dotnet/969 NB: I put both clr.pyd and Python.Runtime.dll in my python root dir (C:\Python26) HTH, Dave From barton at BCDesignsWell.com Thu Dec 16 08:15:39 2010 From: barton at BCDesignsWell.com (Barton) Date: Wed, 15 Dec 2010 23:15:39 -0800 Subject: [Python.NET] building on linux, mono 2.8.1 In-Reply-To: References: <4CFD8C3A.4060206@primefocusworld.com> <4CFEF6C3.6030908@primefocusworld.com> <4CFFFA05.8080008@primefocusworld.com> <4D00348D.8090904@primefocusworld.com> <4D013552.9090806@primefocusworld.com> <4D013694.7050205@primefocusworld.com> <4D0271B4.3090000@primefocusworld.com> Message-ID: <4D09BC9B.8080505@BCDesignsWell.com> I found github to be easy enough to use. The gitExtensions for VS didn't always play nicely, but were workable. That said, I'm still very reliant on TSVN and enjoy the hard work those guys have done on making Windows integration work sooo well. On 12/11/2010 10:25 PM, Brian Lloyd wrote: > Hi all - I've recently taken a position that is MUCH more open-source > friendly. Now that I don't > have to have lawyers parse everything, what do you think about moving > this whole thing to > github? I don't know that I'll have much more time to devote to the > project near term, but I would > really like to lower the barrier-to-entry for folks with a vested > interest in this project to contribute > (and divest myself and others of of managing the SF project). > > Unless anyone objects I think we should migrate the repo to github and > redirect SF there... > > Thoughts? > > - Brian > > > On Fri, Dec 10, 2010 at 1:30 PM, Laszlo Sebo > > wrote: > > We have been using it in maya on windows as well for a long time > actually. We do have some event calling mechanisms as all of our > custom GUI is implemented in the .net assemblies, and they > communice with maya using some event hooks & delegate functions. > > It seems to work well, as long as we are careful. > > In the meantime, i got python.net working with > the latest version of mono (2.8.1). Do you guys mind if i check in > some minor changes to the source? I could post an svn patch here > first. > > > cheers, > laszlo > > > > > On 09/12/2010 7:54 PM, Tribble, Brett wrote: > > Maya works fine with python.net . We use it > all the time. Just remember that Maya is very particular as to > how it handles multithreading, raising events, and the like. > There is some info in the Maya Python SDK regarding how to > deal with Python threading and Maya, and it seems to work with > .NET callbacks as well. I've found that is seems best to add a > flag to your .NET assembly that enables/disable events so that > you can shut them off quickly before you end up with stacked > event callbacks and resulting Maya crashes. If you're not > raising events that percolate into Maya, then you probably > don't need to worry about this. > > > -----Original Message----- > From: pythondotnet-bounces+btribble=ea.com > @python.org > [mailto:pythondotnet-bounces+btribble > =ea.com > @python.org ] On Behalf Of > Laszlo Sebo > Sent: Thursday, December 09, 2010 12:06 PM > To: pythondotnet at python.org > Subject: Re: [Python.NET] building on linux, mono 2.8.1 > > > Sadly, our other target, Maya, seems to be linking python > statically... So I hope i can figure out how to get this > integrated > somehow... > > Actually, scratch that. It seems like it has it's own .so as > well. Time > for some testing.... > > > > cheers, > laszlo > > _________________________________________________ > Python.NET mailing list - PythonDotNet at python.org > > http://mail.python.org/mailman/listinfo/pythondotnet > > > _________________________________________________ > Python.NET mailing list - PythonDotNet at python.org > > http://mail.python.org/mailman/listinfo/pythondotnet > > > > > -- > Brian Lloyd > http://livingsocial.com > (c) 540.845.2975 > > > _________________________________________________ > Python.NET mailing list - PythonDotNet at python.org > http://mail.python.org/mailman/listinfo/pythondotnet -------------- next part -------------- An HTML attachment was scrubbed... URL: From davidgshi at yahoo.co.uk Thu Dec 23 00:38:13 2010 From: davidgshi at yahoo.co.uk (David Shi) Date: Wed, 22 Dec 2010 23:38:13 +0000 (GMT) Subject: [Python.NET] Raising finance for designing and developing a pythondotnet site for global promotion of Pythondotnet In-Reply-To: References: <4D08181C.5060407@primefocusworld.com><4D082298.6020407@primefocusworld.com> <8FBD5A8818E74C0E91F138CF9A03B559@Red5> Message-ID: <915074.35261.qm@web26305.mail.ukl.yahoo.com> I am trying to raise finance to setup and develop a multi-lingual pythondotnet site to promote Pythondotnet globally in London. Pythondotnet is hardly known, taught, used in this part of the world. Certainly, it is true in China. To start with, I would like get a team going to do a English and Chinese site. Can anyone suggest the way forward? I am sure that I will need financial support to start with. Regards. David Shi -------------- next part -------------- An HTML attachment was scrubbed... URL: From julien.faixo at gmail.com Thu Dec 2 12:19:34 2010 From: julien.faixo at gmail.com (Julien faixo) Date: Thu, 02 Dec 2010 11:19:34 -0000 Subject: [Python.NET] [Python.Net] AcquireLock deadlock while calling Python from C# Message-ID: Hi, sorry for the two posts, i was not sure if the mailing list server would let the first one be sent as this address wasn't registered :x I finally managed to solve the issue, and I'm a bit ashamed of the trivialness of the solution but well, it may help someone someday. The difference between the two executions was that as calculation is higly parallelized, the BeginAllowThread() method had to be called at start... Now, this is working just great :) Best regards, Julien -------------- next part -------------- An HTML attachment was scrubbed... URL: From baranguren at gmail.com Sun Dec 5 20:35:08 2010 From: baranguren at gmail.com (Benjamin Aranguren) Date: Sun, 05 Dec 2010 19:35:08 -0000 Subject: [Python.NET] [Python.Net] AcquireLock deadlock while calling Python from C# Message-ID: @Julien I have been calling Python from C# without any problems even in a multi-threaded setup. I am using .Net 2.0 and Python 2.5. Main difference, at least from what I don't see in your code, is I also call BeginAllowThreads() after Initialize(). This allows me to initialize PythonEngine in a different thread once and never have to worry about it again. I remember having similar problem when I first embedded Python and this doc helped me come up with this solution. http://docs.python.org/c-api/init.html#thread-state-and-the-global-interpreter-lock BTW, AcquireLock() below always returns 1. Please let me know if this helps. /* This is in main thread */ if (!PythonEngine.IsInitialized) { PythonEngine.Initialize(); PythonEngine.BeginAllowThreads(); } /* This is ran in another thread */ IntPtr gs = PythonEngine.AcquireLock(); PyObject module = PythonEngine.ImportModule(pymodule); try { PyObject res = module.InvokeMethod(method_name, _args); /* Python calls here */ .... } catch (PythonException pe) { /* Handle python exceptions */ } finally { PythonEngine.ReleaseLock(gs); } -------------- next part -------------- An HTML attachment was scrubbed... URL: