From solospirit at sohu.com Wed Oct 12 21:23:15 2016 From: solospirit at sohu.com (solospirit) Date: Thu, 13 Oct 2016 09:23:15 +0800 (CST) Subject: [Python.NET] call python in Visual C# WinForm application In-Reply-To: <1476195507.3f0fadc08ee54e1b85c6f5fcf490630c.solospirit@sohu.com> Message-ID: <1476321795.985b323369f543c18bf4673345fc9343.solospirit@sohu.com> An HTML attachment was scrubbed... URL: From denis.akhiyarov at gmail.com Thu Oct 13 06:41:14 2016 From: denis.akhiyarov at gmail.com (Denis Akhiyarov) Date: Thu, 13 Oct 2016 05:41:14 -0500 Subject: [Python.NET] call python in Visual C# WinForm application In-Reply-To: <1476321795.985b323369f543c18bf4673345fc9343.solospirit@sohu.com> References: <1476195507.3f0fadc08ee54e1b85c6f5fcf490630c.solospirit@sohu.com> <1476321795.985b323369f543c18bf4673345fc9343.solospirit@sohu.com> Message-ID: You may have much faster response on GitHub issues instead of using this mailing list: https://github.com/pythonnet/pythonnet/issues/new Sometimes it takes few days for messages to post on this mailing list!!! Did you try suggestions for resolving LoaderLock from Stackoverflow? http://stackoverflow.com/questions/12900192/loaderlock-was-detected-with-visual-studio-2012 The problem with first code snippet is that you have ".py" at the end of module name. Inside WinForms there maybe threading issues, but try above first. Did you confirm that loading works without WinForms code? Cheers, Denis On Oct 12, 2016 8:59 PM, "solospirit" wrote: > sorry, i just send it again, since i do not see it at > https://mail.python.org/pipermail/pythondotnet/, i guess it might be > lost, thanks. > > > ----- ???? ----- > > > *????*solospirit > > *?????*2016-10-11 22:18:27 > > *????*A list for users and developers of Python for .NET< > pythondotnet at python.org> > > *? ??*??:Re: [Python.NET] call python in Visual C# WinForm application > > Thanks Denis. > > > I tried the following code, it still does not work, the pModule is NULL. > > //string scriptdir = @"C:\gitcode\neural-networks- > and-deep-learning\src"; > > private void CallPython2(string scriptdir) > > { > > PythonEngine.Initialize(); > > IntPtr pythonLock = PythonEngine.AcquireLock(); > > PythonEngine.RunSimpleString("import sys\n"); > > PythonEngine.RunSimpleString("sys.path.append('" + scriptdir > + "')\n"); > > PyObject pModule = PythonEngine.ImportModule("network2.py"); > > } > > > I also tried the following code, there is exception, see below. > > //string scriptdir = @"C:\gitcode\neural-networks- > and-deep-learning\src"; > > private void CallPython3(string scriptdir) > > { > > using (Py.GIL()) > > { > > dynamic sys = Py.Import("sys"); > > sys.path.append(scriptdir); > > dynamic testmodule = Py.Import("network2"); > > > //the following code works > > //dynamic np = Py.Import("numpy"); > > //dynamic sin = np.sin; > > //double c = np.cos(5) + sin(5); > > //MessageBox.Show(c.ToString()); > > } > > } > > > Exception information: > > LoaderLock was detected > > Message: Attempting managed execution inside OS Loader lock. Do not > attempt to run managed code inside a DllMain or image initialization > function since doing so can cause the application to hang. > > > Actually, my script is called when a button on winform is clicked, it is > not called as the above exception message says. > > > > ----- ???? ----- > > > *????*Denis Akhiyarov > > *?????*2016-09-27 01:54:22 > > *????*A list for users and developers of Python for .NET< > pythondotnet at python.org> > > *? ??*Re: [Python.NET] call python in Visual C# WinForm application > @solospirit: > You are doing illegal things with Python and believe me - it bites back :) > > Remember that in Python you cannot just import modules (.py) just from > arbitrary paths, unless you are using importlib or sys.path. > > Hence here is the correct workflow using sys.path: > > *Microsoft (R) Roslyn C# Compiler version 1.2.0.60425* > *Loading context from 'CSharpInteractive.rsp'.* > *Type "#help" for more information.* > *> #r "C:\Python\Python27_32b\Lib\site-packages\Python.Runtime.dll"* > *> using Python.Runtime;* > *> dynamic sys; using (Py.GIL()) { sys= Py.Import("sys"); }* > *> using (Py.GIL()) { > sys.path.append(@"C:\Users\denis.akhiyarov\Downloads") ; }* > *> dynamic testmodule; using (Py.GIL()) { testmodule = > Py.Import("network2"); }* > *> testmodule.Network* > *[]* > > > Perhaps this should be documented here: > > https://github.com/pythonnet/pythonnet/wiki/pythonnet- > troubleshooting-wiki-on-Windows > > Thanks, > Denis > > > On Mon, Sep 26, 2016 at 8:40 AM, solospirit < solospirit at sohu.com> > wrote: > > > Hi, > > > I'm using windows 7 64bit + Visual C#2012 to develop WinForm 32bit > application with .Net Framework 4.0. I want to call some python script > within my winform application. > > > After read the document, i'm now able to call the following code within my > WinForm application, and the result is correct. > > using (Py.GIL()) > > { > > dynamic np = Py.Import("numpy"); > > dynamic sin = np.sin; > > double c = np.cos(5) + sin(5); > > MessageBox.Show(c.ToString()); > > } > > > I'm using a python script from https://github.com/ > mnielsen/neural-networks-and-deep-learning/blob/master/src/network2.py > by > git clone to my local machine c:\mypath\neural-networks-and-deep-learning, > it works inside python in my system. > > > I tried the following code, but the np returns NULL. > > using (Py.GIL()) > > { > > dynamic np = Py.Import(@"c:\mypath\neural- > networks-and-deep-learning\src\network2"); > > } > > > I also tried the following code, but pModule also returns NULL > > string workingdir = @"c:\mypath\neural-networks- > and-deep-learning\src"; > > PythonEngine.Initialize(); > > IntPtr pythonLock = PythonEngine.AcquireLock(); > > PythonEngine.RunSimpleString("import sys\n"); > > PythonEngine.RunSimpleString("sys.path.append('" + workingdir > + "')\n"); > > PyObject pModule = PythonEngine.ImportModule(workingdir + > "\\network2.py"); > > > How could I invoke such python script, thanks a lot! > > > > > > > ------------------------------ > > > > > > > > _________________________________________________ > Python.NET mailing list - PythonDotNet at python.org > https://mail.python.org/mailman/listinfo/pythondotnet > > > > > > > > > > > _________________________________________________ > Python.NET mailing list - PythonDotNet at python.org > https://mail.python.org/mailman/listinfo/pythondotnet > -------------- next part -------------- An HTML attachment was scrubbed... URL: From denis.akhiyarov at gmail.com Thu Oct 13 17:39:25 2016 From: denis.akhiyarov at gmail.com (Denis Akhiyarov) Date: Thu, 13 Oct 2016 16:39:25 -0500 Subject: [Python.NET] advanced book about Python Message-ID: Hi Python and .NET developers, I would like to purchase a copy of this advanced book about Python for pythonnet contributors: https://thehackerguidetopython.com The cost of professional license to share with 50 people is 199 USD ($), but I will pay it in full if at least 10 people agree to contribute any amount towards the full cost. The book is sold for 29$ for one person. The author agreed to this deal. The author is OpenStack Project Team Leader and Technical Committee Member. [image: Inline image 1] Here is a sample chapter about functional programming, comprehensions, and generators: https://thehackerguidetopython.com/the-hacker-guide-to-python-sample.pdf Please reply to me or here if you would like to get this offer! Thanks, Denis -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 44616 bytes Desc: not available URL: From brian.d.lloyd at gmail.com Thu Oct 13 20:26:46 2016 From: brian.d.lloyd at gmail.com (Brian Lloyd) Date: Thu, 13 Oct 2016 20:26:46 -0400 Subject: [Python.NET] call python in Visual C# WinForm application In-Reply-To: References: <1476195507.3f0fadc08ee54e1b85c6f5fcf490630c.solospirit@sohu.com> <1476321795.985b323369f543c18bf4673345fc9343.solospirit@sohu.com> Message-ID: Hi all - to clarify on Denis? totally legit observation on the mailing list: While I haven?t been able to be particularly active in python.net development for a number of years, I have been the moderator of the mailman list this whole time. We get a pretty huge amount of spam, which is why I?ve kept the list moderated to try to weed that out for folks. While I try to keep up with it every day, sometimes I?m traveling or otherwise offline so sometimes legitimate messages languish for a day or two. If some folks want to volunteer to help with moderation of the list I?m more than happy to open that up to a wider group - let me know if you are interested in lending a hand. On 10/13/16, 6:41 AM, "PythonDotNet on behalf of Denis Akhiyarov" wrote: >You may have much faster response on GitHub issues instead of using this mailing list: >https://github.com/pythonnet/pythonnet/issues/new >Sometimes it takes few days for messages to post on this mailing list!!! >Did you try suggestions for resolving LoaderLock from Stackoverflow? >http://stackoverflow.com/questions/12900192/loaderlock-was-detected-with-visual-studio-2012 >The problem with first code snippet is that you have ".py" at the end of module name. >Inside WinForms there maybe threading issues, but try above first. >Did you confirm that loading works without WinForms code? >Cheers, >Denis > >On Oct 12, 2016 8:59 PM, "solospirit" wrote: > >sorry, i just send it again, since i do not see it at https://mail.python.org/pipermail/pythondotnet/, i guess it might be lost, thanks. > >----- ???? ----- > >????solospirit >?????2016-10-11 22:18:27 >????A list for users and developers of Python for .NET >? ????:Re: [Python.NET] call python in Visual C# WinForm application >Thanks Denis. > >I tried the following code, it still does not work, the pModule is NULL. > > //string scriptdir = @"C:\gitcode\neural-networks-and-deep-learning\src"; > private void CallPython2(string scriptdir) > { > PythonEngine.Initialize(); > IntPtr pythonLock = PythonEngine.AcquireLock(); > PythonEngine.RunSimpleString("import sys\n"); > PythonEngine.RunSimpleString("sys.path.append('" + scriptdir + "')\n"); > PyObject pModule = PythonEngine.ImportModule("network2.py"); > } > >I also tried the following code, there is exception, see below. > //string scriptdir = @"C:\gitcode\neural-networks-and-deep-learning\src"; > private void CallPython3(string scriptdir) > { > using (Py.GIL()) > { > dynamic sys = Py.Import("sys"); > sys.path.append(scriptdir); > dynamic testmodule = Py.Import("network2"); > > //the following code works > //dynamic np = Py.Import("numpy"); > //dynamic sin = np.sin; > //double c = np.cos(5) + sin(5); > //MessageBox.Show(c.ToString()); > } > } > >Exception information: >LoaderLock was detected >Message: Attempting managed execution inside OS Loader lock. Do not attempt to run managed code inside a DllMain or image initialization function since doing so can cause the application to hang. > >Actually, my script is called when a button on winform is clicked, it is not called as the above exception message says. > > >----- ???? ----- > >????Denis Akhiyarov >?????2016-09-27 01:54:22 >????A list for users and developers of Python for .NET >? ??Re: [Python.NET] call python in Visual C# WinForm application >@solospirit: > > > You are doing illegal things with Python and believe me - it bites back :) > > > Remember that in Python you cannot just import modules (.py) just from arbitrary paths, unless you are using importlib or sys.path. > > > Hence here is the correct workflow using sys.path: > > > Microsoft (R) Roslyn C# Compiler version 1.2.0.60425 >Loading context from 'CSharpInteractive.rsp'. >Type "#help" for more information. >> #r "C:\Python\Python27_32b\Lib\site-packages\Python.Runtime.dll" >> using Python.Runtime; >> dynamic sys; using (Py.GIL()) { sys= Py.Import("sys"); } >> using (Py.GIL()) { sys.path.append(@"C:\Users\denis.akhiyarov\Downloads") ; } >> dynamic testmodule; using (Py.GIL()) { testmodule = Py.Import("network2"); } >> testmodule.Network >[] > > > > > > Perhaps this should be documented here: > > > https://github.com/pythonnet/pythonnet/wiki/pythonnet-troubleshooting-wiki-on-Windows > > > > > > Thanks, >Denis > > > > > On Mon, Sep 26, 2016 at 8:40 AM, solospirit < > solospirit at sohu.com> wrote: > > >Hi, > >I'm using windows 7 64bit + Visual C#2012 to develop WinForm 32bit application with .Net Framework 4.0. I want to call some python script within my winform application. > >After read the document, i'm now able to call the following code within my WinForm application, and the result is correct. > > using (Py.GIL()) > { > dynamic np = Py.Import("numpy"); > dynamic sin = np.sin; > double c = np.cos(5) + sin(5); > MessageBox.Show(c.ToString()); > } > >I'm using a python script from https://github.com/mnielsen/neural-networks-and-deep-learning/blob/master/src/network2.py by git clone to my local machine c:\mypath\neural-networks-and-deep-learning, it works inside python in my system. > >I tried the following code, but the np returns NULL. > > using (Py.GIL()) > { > dynamic np = Py.Import(@"c:\mypath\neural-networks-and-deep-learning\src\network2"); > } > >I also tried the following code, but pModule also returns NULL > string workingdir = @"c:\mypath\neural-networks-and-deep-learning\src"; > PythonEngine.Initialize(); > IntPtr pythonLock = PythonEngine.AcquireLock(); > PythonEngine.RunSimpleString("import sys\n"); > PythonEngine.RunSimpleString("sys.path.append('" + workingdir + "')\n"); > PyObject pModule = PythonEngine.ImportModule(workingdir + "\\network2.py"); > >How could I invoke such python script, thanks a lot! > > > > > > > ________________________________________ > > > > > > > > > >_________________________________________________ > >Python.NET mailing list - > PythonDotNet at python.org > > > https://mail.python.org/mailman/listinfo/pythondotnet > > > > > > > > > > > > > > >_________________________________________________ >Python.NET mailing list - PythonDotNet at python.org >https://mail.python.org/mailman/listinfo/pythondotnet > > > > >_________________________________________________ >Python.NET mailing list - PythonDotNet at python.org >https://mail.python.org/mailman/listinfo/pythondotnet From green.azhukov at gmail.com Fri Oct 14 04:45:11 2016 From: green.azhukov at gmail.com (Artem Zhukov) Date: Fri, 14 Oct 2016 08:45:11 +0000 Subject: [Python.NET] See which references I have Message-ID: Hello, is it possible to do something like this: ```for r in clr.References: print r``` I am following up my question on http://stackoverflow.com/questions/40037684/adding-reference-to-net-assembly-which-has-dots-in-name-and-namespace -- ARTEM ZHUKOV | HVAC/Mech.Engineer | Building Performance Engineer | Sustainability Engineer | HVAC TPM | M: +420 774 081 898 -------------- next part -------------- An HTML attachment was scrubbed... URL: From fernandez_dan2 at hotmail.com Fri Oct 14 11:14:13 2016 From: fernandez_dan2 at hotmail.com (Daniel Fernandez) Date: Fri, 14 Oct 2016 09:14:13 -0600 Subject: [Python.NET] advanced book about Python In-Reply-To: References: Message-ID: Hi Denis, I am interested. What do I need to do? I wasn't sure how much to contribute? Thanks. Danny From: denis.akhiyarov at gmail.com Date: Thu, 13 Oct 2016 16:39:25 -0500 To: pythondotnet at python.org Subject: [Python.NET] advanced book about Python Hi Python and .NET developers, I would like to purchase a copy of this advanced book about Python for pythonnet contributors: https://thehackerguidetopython.com The cost of professional license to share with 50 people is 199 USD ($), but I will pay it in full if at least 10 people agree to contribute any amount towards the full cost. The book is sold for 29$ for one person. The author agreed to this deal. The author is OpenStack Project Team Leader and Technical Committee Member. Here is a sample chapter about functional programming, comprehensions, and generators: https://thehackerguidetopython.com/the-hacker-guide-to-python-sample.pdf Please reply to me or here if you would like to get this offer! Thanks,Denis _________________________________________________ Python.NET mailing list - PythonDotNet at python.org https://mail.python.org/mailman/listinfo/pythondotnet -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 44616 bytes Desc: not available URL: From denis.akhiyarov at gmail.com Fri Oct 14 11:48:18 2016 From: denis.akhiyarov at gmail.com (Denis Akhiyarov) Date: Fri, 14 Oct 2016 10:48:18 -0500 Subject: [Python.NET] advanced book about Python In-Reply-To: References: Message-ID: Hi Danny, Thank you for the interest! Once I get response from 5 people or more, then I plan to purchase the $199 package and provide you with access to book, source code and receipt. At that point I'll also send the details about how you can send your contribution to me in the range from 1.0 USD to 20.0 USD :) I have paypal, google wallet, and square cash accounts. Cheers, Denis On Fri, Oct 14, 2016 at 10:14 AM, Daniel Fernandez < fernandez_dan2 at hotmail.com> wrote: > Hi Denis, > > I am interested. What do I need to do? I wasn't sure how much to > contribute? > > Thanks. > > Danny > > ------------------------------ > From: denis.akhiyarov at gmail.com > Date: Thu, 13 Oct 2016 16:39:25 -0500 > To: pythondotnet at python.org > Subject: [Python.NET] advanced book about Python > > Hi Python and .NET developers, > > I would like to purchase a copy of this advanced book about Python for > pythonnet contributors: > > https://thehackerguidetopython.com > > The cost of professional license to share with 50 people is 199 USD ($), > but I will pay it in full if at least 10 people agree to contribute any > amount towards the full cost. The book is sold for 29$ for one person. > > The author agreed to this deal. The author is OpenStack Project Team > Leader and Technical Committee Member. > > > [image: Inline image 1] > > Here is a sample chapter about functional programming, comprehensions, and > generators: > > https://thehackerguidetopython.com/the-hacker-guide-to-python-sample.pdf > > Please reply to me or here if you would like to get this offer! > > Thanks, > Denis > > _________________________________________________ Python.NET mailing list > - PythonDotNet at python.org https://mail.python.org/ > mailman/listinfo/pythondotnet > > _________________________________________________ > Python.NET mailing list - PythonDotNet at python.org > https://mail.python.org/mailman/listinfo/pythondotnet > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 44616 bytes Desc: not available URL: From Ludovic.Pochon-Guerin at statkraft.com Fri Oct 14 03:09:22 2016 From: Ludovic.Pochon-Guerin at statkraft.com (=?utf-8?B?UG9jaG9uLUd1w6lyaW4gTHVkb3ZpYw==?=) Date: Fri, 14 Oct 2016 07:09:22 +0000 Subject: [Python.NET] advanced book about Python In-Reply-To: References: Message-ID: Yes please, I want to contribute to get a copy. Mvh Ludovic From: PythonDotNet [mailto:pythondotnet-bounces+ludovic.pochon-guerin=statkraft.com at python.org] On Behalf Of Denis Akhiyarov Sent: 13. oktober 2016 23:39 To: A list for users and developers of Python for .NET Subject: [Python.NET] advanced book about Python Hi Python and .NET developers, I would like to purchase a copy of this advanced book about Python for pythonnet contributors: https://thehackerguidetopython.com The cost of professional license to share with 50 people is 199 USD ($), but I will pay it in full if at least 10 people agree to contribute any amount towards the full cost. The book is sold for 29$ for one person. The author agreed to this deal. The author is OpenStack Project Team Leader and Technical Committee Member. [Inline image 1] Here is a sample chapter about functional programming, comprehensions, and generators: https://thehackerguidetopython.com/the-hacker-guide-to-python-sample.pdf Please reply to me or here if you would like to get this offer! Thanks, Denis -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.png Type: image/png Size: 31643 bytes Desc: image001.png URL: From green.azhukov at gmail.com Mon Oct 17 01:07:23 2016 From: green.azhukov at gmail.com (Artem Zhukov) Date: Mon, 17 Oct 2016 05:07:23 +0000 Subject: [Python.NET] Referencing a DLL Message-ID: Hello all, please help me to resolve the following problem. I was trying a lot of things (see 1) and still didn't get it. There is also a project on freelancer for that (see 2): 1. http://stackoverflow.com/questions/40037684/adding-reference-to-net-assembly-which-has-dots-in-name-and-namespace 2. https://www.freelancer.com/contest/Write-some-Software-867914.html -- ARTEM ZHUKOV | HVAC/Mech.Engineer | Building Performance Engineer | Sustainability Engineer | HVAC TPM | M: +420 774 081 898 -------------- next part -------------- An HTML attachment was scrubbed... URL: From germano.carella at gmail.com Mon Oct 17 01:19:59 2016 From: germano.carella at gmail.com (germano.carella at gmail.com) Date: Mon, 17 Oct 2016 07:19:59 +0200 Subject: [Python.NET] Problems installing pythonnet on ubuntu 16.04 Message-ID: <58045f7f.c775c20a.a1508.8ebd@mx.google.com> Hi to all, I?m trying to install pythonnet on ubuntu 16.04. I installed mono-complete Apt-get install mono-complete It seems to be work. Now Pip install pythonnet. This is the log: Collecting pythonnet Using cached pythonnet-2.1.0.zip Building wheels for collected packages: pythonnet Running setup.py bdist_wheel for pythonnet: started Running setup.py bdist_wheel for pythonnet: finished with status 'error' Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-qU3Z2m/pythonnet/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" bdist_wheel -d /tmp/tmpEQkI3_pip-wheel- --python-tag cp27: running bdist_wheel running build running build_ext ??????Installing 'NUnit 2.6.2'. Installing 'UnmanagedExports 1.2.6'. Successfully installed 'NUnit 2.6.2'. Successfully installed 'UnmanagedExports 1.2.6'. XBuild Engine Version 12.0 Mono, Version 4.2.1.0 Copyright (C) 2005-2013 Various Mono authors /tmp/pip-build-qU3Z2m/pythonnet/pythonnet.sln: warning : The project configuration for project 'clrmodule' corresponding to the solution configuration 'ReleaseMono|x64' was not found. XBuild Engine Version 12.0 Mono, Version 4.2.1.0 Copyright (C) 2005-2013 Various Mono authors Configuration: ReleaseMono Platform: x64 /tmp/pip-build-qU3Z2m/pythonnet/pythonnet.sln: warning : The project configuration for project 'clrmodule' corresponding to the solution configuration 'ReleaseMono|x64' was not found. Configuration: ReleaseMono Platform: x64 CSC: error CS0518: The predefined type `System.Object' is not defined or imported CSC: error CS0518: The predefined type `System.ValueType' is not defined or imported CSC: error CS0518: The predefined type `System.Attribute' is not defined or imported CSC: error CS0518: The predefined type `System.Int32' is not defined or imported CSC: error CS0518: The predefined type `System.UInt32' is not defined or imported CSC: error CS0518: The predefined type `System.Int64' is not defined or imported CSC: error CS0518: The predefined type `System.UInt64' is not defined or imported CSC: error CS0518: The predefined type `System.Single' is not defined or imported CSC: error CS0518: The predefined type `System.Double' is not defined or imported CSC: error CS0518: The predefined type `System.Char' is not defined or imported CSC: error CS0518: The predefined type `System.Int16' is not defined or imported CSC: error CS0518: The predefined type `System.Decimal' is not defined or imported CSC: error CS0518: The predefined type `System.Boolean' is not defined or imported CSC: error CS0518: The predefined type `System.SByte' is not defined or imported CSC: error CS0518: The predefined type `System.Byte' is not defined or imported CSC: error CS0518: The predefined type `System.UInt16' is not defined or imported CSC: error CS0518: The predefined type `System.String' is not defined or imported CSC: error CS0518: The predefined type `System.Enum' is not defined or imported CSC: error CS0518: The predefined type `System.Delegate' is not defined or imported CSC: error CS0518: The predefined type `System.MulticastDelegate' is not defined or imported CSC: error CS0518: The predefined type `System.Void' is not defined or imported CSC: error CS0518: The predefined type `System.Array' is not defined or imported CSC: error CS0518: The predefined type `System.Type' is not defined or imported CSC: error CS0518: The predefined type `System.Collections.IEnumerator' is not defined or imported CSC: error CS0518: The predefined type `System.Collections.IEnumerable' is not defined or imported CSC: error CS0518: The predefined type `System.IDisposable' is not defined or imported CSC: error CS0518: The predefined type `System.IntPtr' is not defined or imported CSC: error CS0518: The predefined type `System.UIntPtr' is not defined or imported CSC: error CS0518: The predefined type `System.RuntimeFieldHandle' is not defined or imported CSC: error CS0518: The predefined type `System.RuntimeTypeHandle' is not defined or imported CSC: error CS0518: The predefined type `System.Exception' is not defined or imported Configuration: ReleaseMono Platform: x64 Traceback (most recent call last): File "", line 1, in File "/tmp/pip-build-qU3Z2m/pythonnet/setup.py", line 357, in setup_requires=setup_requires File "/usr/lib/python2.7/distutils/core.py", line 151, in setup dist.run_commands() File "/usr/lib/python2.7/distutils/dist.py", line 953, in run_commands self.run_command(cmd) File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command cmd_obj.run() File "/usr/lib/python2.7/dist-packages/wheel/bdist_wheel.py", line 179, in run self.run_command('build') File "/usr/lib/python2.7/distutils/cmd.py", line 326, in run_command self.distribution.run_command(command) File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command cmd_obj.run() File "/usr/lib/python2.7/distutils/command/build.py", line 128, in run self.run_command(cmd_name) File "/usr/lib/python2.7/distutils/cmd.py", line 326, in run_command self.distribution.run_command(command) File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command cmd_obj.run() File "/usr/lib/python2.7/distutils/command/build_ext.py", line 339, in run self.build_extensions() File "/usr/lib/python2.7/distutils/command/build_ext.py", line 448, in build_extensions self.build_extension(ext) File "/tmp/pip-build-qU3Z2m/pythonnet/setup.py", line 188, in build_extension check_call(" ".join(cmd + ["/t:Build"]), shell=use_shell) File "/usr/lib/python2.7/subprocess.py", line 541, in check_call raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command 'xbuild pythonnet.sln /p:Configuration=ReleaseMono /p:Platform=x64 /p:DefineConstants="PYTHON27,UCS4,MONO_LINUX" /p:PythonBuildDir="/tmp/pip-build-qU3Z2m/pythonnet/build/lib.linux-x86_64-2.7" /p:PythonInteropFile="interop27.cs" /verbosity:minimal /t:Build' returned non-zero exit status 1 ---------------------------------------- Failed building wheel for pythonnet Running setup.py clean for pythonnet Failed to build pythonnet Installing collected packages: pythonnet Running setup.py install for pythonnet: started Running setup.py install for pythonnet: finished with status 'error' Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-qU3Z2m/pythonnet/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-gbLWSw-record/install-record.txt --single-version-externally-managed --compile: running install running build running build_ext ??????Tutti i pacchetti elencati in packages.configsono gi?? installati. XBuild Engine Version 12.0 Mono, Version 4.2.1.0 Copyright (C) 2005-2013 Various Mono authors /tmp/pip-build-qU3Z2m/pythonnet/pythonnet.sln: warning : The project configuration for project 'clrmodule' corresponding to the solution configuration 'ReleaseMono|x64' was not found. XBuild Engine Version 12.0 Mono, Version 4.2.1.0 Copyright (C) 2005-2013 Various Mono authors Configuration: ReleaseMono Platform: x64 /tmp/pip-build-qU3Z2m/pythonnet/pythonnet.sln: warning : The project configuration for project 'clrmodule' corresponding to the solution configuration 'ReleaseMono|x64' was not found. Configuration: ReleaseMono Platform: x64 CSC: error CS0518: The predefined type `System.Object' is not defined or imported CSC: error CS0518: The predefined type `System.ValueType' is not defined or imported CSC: error CS0518: The predefined type `System.Attribute' is not defined or imported CSC: error CS0518: The predefined type `System.Int32' is not defined or imported CSC: error CS0518: The predefined type `System.UInt32' is not defined or imported CSC: error CS0518: The predefined type `System.Int64' is not defined or imported CSC: error CS0518: The predefined type `System.UInt64' is not defined or imported CSC: error CS0518: The predefined type `System.Single' is not defined or imported CSC: error CS0518: The predefined type `System.Double' is not defined or imported CSC: error CS0518: The predefined type `System.Char' is not defined or imported CSC: error CS0518: The predefined type `System.Int16' is not defined or imported CSC: error CS0518: The predefined type `System.Decimal' is not defined or imported CSC: error CS0518: The predefined type `System.Boolean' is not defined or imported CSC: error CS0518: The predefined type `System.SByte' is not defined or imported CSC: error CS0518: The predefined type `System.Byte' is not defined or imported CSC: error CS0518: The predefined type `System.UInt16' is not defined or imported CSC: error CS0518: The predefined type `System.String' is not defined or imported CSC: error CS0518: The predefined type `System.Enum' is not defined or imported CSC: error CS0518: The predefined type `System.Delegate' is not defined or imported CSC: error CS0518: The predefined type `System.MulticastDelegate' is not defined or imported CSC: error CS0518: The predefined type `System.Void' is not defined or imported CSC: error CS0518: The predefined type `System.Array' is not defined or imported CSC: error CS0518: The predefined type `System.Type' is not defined or imported CSC: error CS0518: The predefined type `System.Collections.IEnumerator' is not defined or imported CSC: error CS0518: The predefined type `System.Collections.IEnumerable' is not defined or imported CSC: error CS0518: The predefined type `System.IDisposable' is not defined or imported CSC: error CS0518: The predefined type `System.IntPtr' is not defined or imported CSC: error CS0518: The predefined type `System.UIntPtr' is not defined or imported CSC: error CS0518: The predefined type `System.RuntimeFieldHandle' is not defined or imported CSC: error CS0518: The predefined type `System.RuntimeTypeHandle' is not defined or imported CSC: error CS0518: The predefined type `System.Exception' is not defined or imported Configuration: ReleaseMono Platform: x64 Traceback (most recent call last): File "", line 1, in File "/tmp/pip-build-qU3Z2m/pythonnet/setup.py", line 357, in setup_requires=setup_requires File "/usr/lib/python2.7/distutils/core.py", line 151, in setup dist.run_commands() File "/usr/lib/python2.7/distutils/dist.py", line 953, in run_commands self.run_command(cmd) File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command cmd_obj.run() File "/usr/lib/python2.7/dist-packages/setuptools/command/install.py", line 61, in run return orig.install.run(self) File "/usr/lib/python2.7/distutils/command/install.py", line 601, in run self.run_command('build') File "/usr/lib/python2.7/distutils/cmd.py", line 326, in run_command self.distribution.run_command(command) File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command cmd_obj.run() File "/usr/lib/python2.7/distutils/command/build.py", line 128, in run self.run_command(cmd_name) File "/usr/lib/python2.7/distutils/cmd.py", line 326, in run_command self.distribution.run_command(command) File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command cmd_obj.run() File "/usr/lib/python2.7/distutils/command/build_ext.py", line 339, in run self.build_extensions() File "/usr/lib/python2.7/distutils/command/build_ext.py", line 448, in build_extensions self.build_extension(ext) File "/tmp/pip-build-qU3Z2m/pythonnet/setup.py", line 188, in build_extension check_call(" ".join(cmd + ["/t:Build"]), shell=use_shell) File "/usr/lib/python2.7/subprocess.py", line 541, in check_call raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command 'xbuild pythonnet.sln /p:Configuration=ReleaseMono /p:Platform=x64 /p:DefineConstants="PYTHON27,UCS4,MONO_LINUX" /p:PythonBuildDir="/tmp/pip-build-qU3Z2m/pythonnet/build/lib.linux-x86_64-2.7" /p:PythonInteropFile="interop27.cs" /verbosity:minimal /t:Build' returned non-zero exit status 1 ---------------------------------------- Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-qU3Z2m/pythonnet/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-gbLWSw-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-qU3Z2m/pythonnet/ Ok, I don?t understand, but all types are broken? it is strange. Help! Inviato da Posta per Windows 10 -------------- next part -------------- An HTML attachment was scrubbed... URL: From denis.akhiyarov at gmail.com Mon Oct 17 07:32:47 2016 From: denis.akhiyarov at gmail.com (Denis Akhiyarov) Date: Mon, 17 Oct 2016 11:32:47 +0000 Subject: [Python.NET] Problems installing pythonnet on ubuntu 16.04 In-Reply-To: <58045f7f.c775c20a.a1508.8ebd@mx.google.com> References: <58045f7f.c775c20a.a1508.8ebd@mx.google.com> Message-ID: Hi Germano, The errors with types are indeed strange. But can you please follow build procedure that is setup on Travis CI? Particularly use Mono 4.2.4.4. https://github.com/pythonnet/pythonnet/blob/master/.travis.yml Also do `pip install pythonnet --pre -U`, since `pythonnet 2.1.0` is not latest and is missing `geninterop.py` when building from source. Finally try switching your localization to English - this helped once. Even after building successfully, you may have crash at `import clr` due Python issue on Ubuntu, which is resolved by patching `setup.py` like described here: https://github.com/pythonnet/pythonnet/issues/119 Regards, Denis On Mon, Oct 17, 2016, 6:06 AM wrote: > Hi to all, > > I?m trying to install pythonnet on ubuntu 16.04. > > I installed mono-complete > > Apt-get install mono-complete > > It seems to be work. > > Now > > Pip install pythonnet. > > This is the log: > > Collecting pythonnet > > Using cached pythonnet-2.1.0.zip > > Building wheels for collected packages: pythonnet > > Running setup.py bdist_wheel for pythonnet: started > > Running setup.py bdist_wheel for pythonnet: finished with status 'error' > > Complete output from command /usr/bin/python -u -c "import setuptools, > tokenize;__file__='/tmp/pip-build-qU3Z2m/pythonnet/setup.py';exec(compile(getattr(tokenize, > 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" > bdist_wheel -d /tmp/tmpEQkI3_pip-wheel- --python-tag cp27: > > running bdist_wheel > > running build > > running build_ext > > ??????Installing 'NUnit 2.6.2'. > > Installing 'UnmanagedExports 1.2.6'. > > Successfully installed 'NUnit 2.6.2'. > > Successfully installed 'UnmanagedExports 1.2.6'. > > XBuild Engine Version 12.0 > > Mono, Version 4.2.1.0 > > Copyright (C) 2005-2013 Various Mono authors > > /tmp/pip-build-qU3Z2m/pythonnet/pythonnet.sln: warning : The project > configuration for project 'clrmodule' corresponding to the solution > configuration 'ReleaseMono|x64' was not found. > > XBuild Engine Version 12.0 > > Mono, Version 4.2.1.0 > > Copyright (C) 2005-2013 Various Mono authors > > Configuration: ReleaseMono Platform: x64 > > /tmp/pip-build-qU3Z2m/pythonnet/pythonnet.sln: warning : The project > configuration for project 'clrmodule' corresponding to the solution > configuration 'ReleaseMono|x64' was not found. > > Configuration: ReleaseMono Platform: x64 > > CSC: error CS0518: The predefined type `System.Object' is not defined or > imported > > CSC: error CS0518: The predefined type `System.ValueType' is not defined > or imported > > CSC: error CS0518: The predefined type `System.Attribute' is not defined > or imported > > CSC: error CS0518: The predefined type `System.Int32' is not defined or > imported > > CSC: error CS0518: The predefined type `System.UInt32' is not defined or > imported > > CSC: error CS0518: The predefined type `System.Int64' is not defined or > imported > > CSC: error CS0518: The predefined type `System.UInt64' is not defined or > imported > > CSC: error CS0518: The predefined type `System.Single' is not defined or > imported > > CSC: error CS0518: The predefined type `System.Double' is not defined or > imported > > CSC: error CS0518: The predefined type `System.Char' is not defined or > imported > > CSC: error CS0518: The predefined type `System.Int16' is not defined or > imported > > CSC: error CS0518: The predefined type `System.Decimal' is not defined > or imported > > CSC: error CS0518: The predefined type `System.Boolean' is not defined > or imported > > CSC: error CS0518: The predefined type `System.SByte' is not defined or > imported > > CSC: error CS0518: The predefined type `System.Byte' is not defined or > imported > > CSC: error CS0518: The predefined type `System.UInt16' is not defined or > imported > > CSC: error CS0518: The predefined type `System.String' is not defined or > imported > > CSC: error CS0518: The predefined type `System.Enum' is not defined or > imported > > CSC: error CS0518: The predefined type `System.Delegate' is not defined > or imported > > CSC: error CS0518: The predefined type `System.MulticastDelegate' is not > defined or imported > > CSC: error CS0518: The predefined type `System.Void' is not defined or > imported > > CSC: error CS0518: The predefined type `System.Array' is not defined or > imported > > CSC: error CS0518: The predefined type `System.Type' is not defined or > imported > > CSC: error CS0518: The predefined type `System.Collections.IEnumerator' > is not defined or imported > > CSC: error CS0518: The predefined type `System.Collections.IEnumerable' > is not defined or imported > > CSC: error CS0518: The predefined type `System.IDisposable' is not > defined or imported > > CSC: error CS0518: The predefined type `System.IntPtr' is not defined or > imported > > CSC: error CS0518: The predefined type `System.UIntPtr' is not defined > or imported > > CSC: error CS0518: The predefined type `System.RuntimeFieldHandle' is > not defined or imported > > CSC: error CS0518: The predefined type `System.RuntimeTypeHandle' is not > defined or imported > > CSC: error CS0518: The predefined type `System.Exception' is not defined > or imported > > Configuration: ReleaseMono Platform: x64 > > Traceback (most recent call last): > > File "", line 1, in > > File "/tmp/pip-build-qU3Z2m/pythonnet/setup.py", line 357, in > > setup_requires=setup_requires > > File "/usr/lib/python2.7/distutils/core.py", line 151, in setup > > dist.run_commands() > > File "/usr/lib/python2.7/distutils/dist.py", line 953, in run_commands > > self.run_command(cmd) > > File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command > > cmd_obj.run() > > File "/usr/lib/python2.7/dist-packages/wheel/bdist_wheel.py", line > 179, in run > > self.run_command('build') > > File "/usr/lib/python2.7/distutils/cmd.py", line 326, in run_command > > self.distribution.run_command(command) > > File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command > > cmd_obj.run() > > File "/usr/lib/python2.7/distutils/command/build.py", line 128, in run > > self.run_command(cmd_name) > > File "/usr/lib/python2.7/distutils/cmd.py", line 326, in run_command > > self.distribution.run_command(command) > > File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command > > cmd_obj.run() > > File "/usr/lib/python2.7/distutils/command/build_ext.py", line 339, in > run > > self.build_extensions() > > File "/usr/lib/python2.7/distutils/command/build_ext.py", line 448, in > build_extensions > > self.build_extension(ext) > > File "/tmp/pip-build-qU3Z2m/pythonnet/setup.py", line 188, in > build_extension > > check_call(" ".join(cmd + ["/t:Build"]), shell=use_shell) > > File "/usr/lib/python2.7/subprocess.py", line 541, in check_call > > raise CalledProcessError(retcode, cmd) > > subprocess.CalledProcessError: Command 'xbuild pythonnet.sln > /p:Configuration=ReleaseMono /p:Platform=x64 > /p:DefineConstants="PYTHON27,UCS4,MONO_LINUX" > /p:PythonBuildDir="/tmp/pip-build-qU3Z2m/pythonnet/build/lib.linux-x86_64-2.7" > /p:PythonInteropFile="interop27.cs" /verbosity:minimal /t:Build' returned > non-zero exit status 1 > > > > ---------------------------------------- > > Failed building wheel for pythonnet > > Running setup.py clean for pythonnet > > Failed to build pythonnet > > Installing collected packages: pythonnet > > Running setup.py install for pythonnet: started > > Running setup.py install for pythonnet: finished with status 'error' > > Complete output from command /usr/bin/python -u -c "import setuptools, > tokenize;__file__='/tmp/pip-build-qU3Z2m/pythonnet/setup.py';exec(compile(getattr(tokenize, > 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" > install --record /tmp/pip-gbLWSw-record/install-record.txt > --single-version-externally-managed --compile: > > running install > > running build > > running build_ext > > ??????Tutti i pacchetti elencati in packages.configsono gi? > installati. > > XBuild Engine Version 12.0 > > Mono, Version 4.2.1.0 > > Copyright (C) 2005-2013 Various Mono authors > > /tmp/pip-build-qU3Z2m/pythonnet/pythonnet.sln: warning : The project > configuration for project 'clrmodule' corresponding to the solution > configuration 'ReleaseMono|x64' was not found. > > XBuild Engine Version 12.0 > > Mono, Version 4.2.1.0 > > Copyright (C) 2005-2013 Various Mono authors > > Configuration: ReleaseMono Platform: x64 > > /tmp/pip-build-qU3Z2m/pythonnet/pythonnet.sln: warning : The project > configuration for project 'clrmodule' corresponding to the solution > configuration 'ReleaseMono|x64' was not found. > > Configuration: ReleaseMono Platform: x64 > > CSC: error CS0518: The predefined type `System.Object' is not defined > or imported > > CSC: error CS0518: The predefined type `System.ValueType' is not > defined or imported > > CSC: error CS0518: The predefined type `System.Attribute' is not > defined or imported > > CSC: error CS0518: The predefined type `System.Int32' is not defined > or imported > > CSC: error CS0518: The predefined type `System.UInt32' is not defined > or imported > > CSC: error CS0518: The predefined type `System.Int64' is not defined > or imported > > CSC: error CS0518: The predefined type `System.UInt64' is not defined > or imported > > CSC: error CS0518: The predefined type `System.Single' is not defined > or imported > > CSC: error CS0518: The predefined type `System.Double' is not defined > or imported > > CSC: error CS0518: The predefined type `System.Char' is not defined or > imported > > CSC: error CS0518: The predefined type `System.Int16' is not defined > or imported > > CSC: error CS0518: The predefined type `System.Decimal' is not defined > or imported > > CSC: error CS0518: The predefined type `System.Boolean' is not defined > or imported > > CSC: error CS0518: The predefined type `System.SByte' is not defined > or imported > > CSC: error CS0518: The predefined type `System.Byte' is not defined or > imported > > CSC: error CS0518: The predefined type `System.UInt16' is not defined > or imported > > CSC: error CS0518: The predefined type `System.String' is not defined > or imported > > CSC: error CS0518: The predefined type `System.Enum' is not defined or > imported > > CSC: error CS0518: The predefined type `System.Delegate' is not > defined or imported > > CSC: error CS0518: The predefined type `System.MulticastDelegate' is > not defined or imported > > CSC: error CS0518: The predefined type `System.Void' is not defined or > imported > > CSC: error CS0518: The predefined type `System.Array' is not defined > or imported > > CSC: error CS0518: The predefined type `System.Type' is not defined or > imported > > CSC: error CS0518: The predefined type > `System.Collections.IEnumerator' is not defined or imported > > CSC: error CS0518: The predefined type > `System.Collections.IEnumerable' is not defined or imported > > CSC: error CS0518: The predefined type `System.IDisposable' is not > defined or imported > > CSC: error CS0518: The predefined type `System.IntPtr' is not defined > or imported > > CSC: error CS0518: The predefined type `System.UIntPtr' is not defined > or imported > > CSC: error CS0518: The predefined type `System.RuntimeFieldHandle' is > not defined or imported > > CSC: error CS0518: The predefined type `System.RuntimeTypeHandle' is > not defined or imported > > CSC: error CS0518: The predefined type `System.Exception' is not > defined or imported > > Configuration: ReleaseMono Platform: x64 > > Traceback (most recent call last): > > File "", line 1, in > > File "/tmp/pip-build-qU3Z2m/pythonnet/setup.py", line 357, in > > > setup_requires=setup_requires > > File "/usr/lib/python2.7/distutils/core.py", line 151, in setup > > dist.run_commands() > > File "/usr/lib/python2.7/distutils/dist.py", line 953, in > run_commands > > self.run_command(cmd) > > File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command > > cmd_obj.run() > > File > "/usr/lib/python2.7/dist-packages/setuptools/command/install.py", line 61, > in run > > return orig.install.run(self) > > File "/usr/lib/python2.7/distutils/command/install.py", line 601, in > run > > self.run_command('build') > > File "/usr/lib/python2.7/distutils/cmd.py", line 326, in run_command > > self.distribution.run_command(command) > > File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command > > cmd_obj.run() > > File "/usr/lib/python2.7/distutils/command/build.py", line 128, in > run > > self.run_command(cmd_name) > > File "/usr/lib/python2.7/distutils/cmd.py", line 326, in run_command > > self.distribution.run_command(command) > > File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command > > cmd_obj.run() > > File "/usr/lib/python2.7/distutils/command/build_ext.py", line 339, > in run > > self.build_extensions() > > File "/usr/lib/python2.7/distutils/command/build_ext.py", line 448, > in build_extensions > > self.build_extension(ext) > > File "/tmp/pip-build-qU3Z2m/pythonnet/setup.py", line 188, in > build_extension > > check_call(" ".join(cmd + ["/t:Build"]), shell=use_shell) > > File "/usr/lib/python2.7/subprocess.py", line 541, in check_call > > raise CalledProcessError(retcode, cmd) > > subprocess.CalledProcessError: Command 'xbuild pythonnet.sln > /p:Configuration=ReleaseMono /p:Platform=x64 > /p:DefineConstants="PYTHON27,UCS4,MONO_LINUX" > /p:PythonBuildDir="/tmp/pip-build-qU3Z2m/pythonnet/build/lib.linux-x86_64-2.7" > /p:PythonInteropFile="interop27.cs" /verbosity:minimal /t:Build' returned > non-zero exit status 1 > > > > ---------------------------------------- > > Command "/usr/bin/python -u -c "import setuptools, > tokenize;__file__='/tmp/pip-build-qU3Z2m/pythonnet/setup.py';exec(compile(getattr(tokenize, > 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" > install --record /tmp/pip-gbLWSw-record/install-record.txt > --single-version-externally-managed --compile" failed with error code 1 in > /tmp/pip-build-qU3Z2m/pythonnet/ > > Ok, I don?t understand, but all types are broken? it is strange. > > Help! > > > > Inviato da Posta per > Windows 10 > > > _________________________________________________ > Python.NET mailing list - PythonDotNet at python.org > https://mail.python.org/mailman/listinfo/pythondotnet -------------- next part -------------- An HTML attachment was scrubbed... URL: From denis.akhiyarov at gmail.com Mon Oct 17 08:12:10 2016 From: denis.akhiyarov at gmail.com (Denis Akhiyarov) Date: Mon, 17 Oct 2016 12:12:10 +0000 Subject: [Python.NET] Referencing a DLL In-Reply-To: References: Message-ID: Hi Artem, If clr.FindAssembly("isc.Eng.Hov") and clr.AddReference("isc.Eng.Hov") are working fine, then you need to `import HovEngine`, but not `import isc.Eng.Hov`. This is assuming isc.Eng.Hov is assembly name, and HovEngine is namespace name. Thanks, Denis On Mon, Oct 17, 2016, 12:08 AM Artem Zhukov wrote: > Hello all, > please help me to resolve the following problem. I was trying a lot of > things (see 1) and still didn't get it. There is also a project on > freelancer for that (see 2): > > 1. > http://stackoverflow.com/questions/40037684/adding-reference-to-net-assembly-which-has-dots-in-name-and-namespace > 2. https://www.freelancer.com/contest/Write-some-Software-867914.html > > > -- > ARTEM ZHUKOV | HVAC/Mech.Engineer | Building Performance Engineer | > Sustainability Engineer | HVAC TPM | M: +420 774 081 898 > _________________________________________________ > Python.NET mailing list - PythonDotNet at python.org > https://mail.python.org/mailman/listinfo/pythondotnet -------------- next part -------------- An HTML attachment was scrubbed... URL: From green.azhukov at gmail.com Mon Oct 17 09:32:39 2016 From: green.azhukov at gmail.com (Artem Zhukov) Date: Mon, 17 Oct 2016 13:32:39 +0000 Subject: [Python.NET] Referencing a DLL In-Reply-To: References: Message-ID: Denis, 1. from isc.Eng.Hov import * . Result: ImportError: No module named isc.Eng.Hov 2. import HovEngine. Result: ImportError: No module named HovEngine 3. import isc.Eng.Hov.HovEngine. Result: ImportError: No module named isc.Eng.Hov.HovEngine 4. from isc.Eng.Hov.HovEngine import *. Result ImportError: No module named isc.Eng.Hov.HovEngine I don't know where the mistake could be hidden. As I see from object browser the namespace is HovEngine. [image: unspecified.jpg] Then, what's wrong? On Mon, Oct 17, 2016 at 2:12 PM Denis Akhiyarov wrote: Hi Artem, If clr.FindAssembly("isc.Eng.Hov") and clr.AddReference("isc.Eng.Hov") are working fine, then you need to `import HovEngine`, but not `import isc.Eng.Hov`. This is assuming isc.Eng.Hov is assembly name, and HovEngine is namespace name. Thanks, Denis On Mon, Oct 17, 2016, 12:08 AM Artem Zhukov wrote: Hello all, please help me to resolve the following problem. I was trying a lot of things (see 1) and still didn't get it. There is also a project on freelancer for that (see 2): 1. http://stackoverflow.com/questions/40037684/adding-reference-to-net-assembly-which-has-dots-in-name-and-namespace 2. https://www.freelancer.com/contest/Write-some-Software-867914.html -- ARTEM ZHUKOV | HVAC/Mech.Engineer | Building Performance Engineer | Sustainability Engineer | HVAC TPM | M: +420 774 081 898 <774%20081%20898> _________________________________________________ Python.NET mailing list - PythonDotNet at python.org https://mail.python.org/mailman/listinfo/pythondotnet _________________________________________________ Python.NET mailing list - PythonDotNet at python.org https://mail.python.org/mailman/listinfo/pythondotnet -- ARTEM ZHUKOV | HVAC/Mech.Engineer | Building Performance Engineer | Sustainability Engineer | HVAC TPM | M: +420 774 081 898 -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: unspecified.jpg Type: image/jpeg Size: 6278 bytes Desc: not available URL: From denis.akhiyarov at gmail.com Mon Oct 17 10:28:36 2016 From: denis.akhiyarov at gmail.com (Denis Akhiyarov) Date: Mon, 17 Oct 2016 09:28:36 -0500 Subject: [Python.NET] Referencing a DLL In-Reply-To: References: Message-ID: I used ILSPY to inspect your dll and here is how you need to use it (just tried and it works!): In [1]: import clr In [2]: import sys In [3]: sys.path.append(r"C:\Users\denis.akhiyarov\Downloads\TestEngine_Compile ...: d") In [4]: clr.AddReference("isc.Eng.Hov") Out[4]: In [5]: import isc.Eng.Hov In [6]: from isc.Eng.Hov import * On Mon, Oct 17, 2016 at 8:32 AM, Artem Zhukov wrote: > Denis, > > 1. from isc.Eng.Hov import * . Result: ImportError: No module named > isc.Eng.Hov > 2. import HovEngine. Result: ImportError: No module named HovEngine > 3. import isc.Eng.Hov.HovEngine. Result: ImportError: No module named > isc.Eng.Hov.HovEngine > 4. from isc.Eng.Hov.HovEngine import *. Result ImportError: No module > named isc.Eng.Hov.HovEngine > > I don't know where the mistake could be hidden. As I see from object > browser the namespace is HovEngine. > [image: unspecified.jpg] > Then, what's wrong? > > On Mon, Oct 17, 2016 at 2:12 PM Denis Akhiyarov > wrote: > > Hi Artem, > > If clr.FindAssembly("isc.Eng.Hov") and clr.AddReference("isc.Eng.Hov") > are working fine, then you need to `import HovEngine`, but not `import > isc.Eng.Hov`. > > This is assuming isc.Eng.Hov is assembly name, and HovEngine is namespace > name. > > Thanks, > Denis > > On Mon, Oct 17, 2016, 12:08 AM Artem Zhukov > wrote: > > Hello all, > please help me to resolve the following problem. I was trying a lot of > things (see 1) and still didn't get it. There is also a project on > freelancer for that (see 2): > > 1. http://stackoverflow.com/questions/40037684/adding- > reference-to-net-assembly-which-has-dots-in-name-and-namespace > > 2. https://www.freelancer.com/contest/Write-some-Software-867914.html > > > -- > ARTEM ZHUKOV | HVAC/Mech.Engineer | Building Performance Engineer | > Sustainability Engineer | HVAC TPM | M: +420 774 081 898 <774%20081%20898> > > _________________________________________________ > Python.NET mailing list - PythonDotNet at python.org > https://mail.python.org/mailman/listinfo/pythondotnet > > _________________________________________________ > Python.NET mailing list - PythonDotNet at python.org > https://mail.python.org/mailman/listinfo/pythondotnet > > -- > ARTEM ZHUKOV | HVAC/Mech.Engineer | Building Performance Engineer | > Sustainability Engineer | HVAC TPM | M: +420 774 081 898 > > _________________________________________________ > Python.NET mailing list - PythonDotNet at python.org > https://mail.python.org/mailman/listinfo/pythondotnet > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: unspecified.jpg Type: image/jpeg Size: 6278 bytes Desc: not available URL: From green.azhukov at gmail.com Mon Oct 17 10:56:43 2016 From: green.azhukov at gmail.com (Artem Zhukov) Date: Mon, 17 Oct 2016 14:56:43 +0000 Subject: [Python.NET] Referencing a DLL In-Reply-To: References: Message-ID: On my machine: In [6]: clr.AddReference("isc.Eng.Hov") Out[6]: In [7]: import isc.Eng.Hov --------------------------------------------------------------------------- ImportError Traceback (most recent call last) in () ----> 1 import isc.Eng.Hov ImportError: No module named isc.Eng.Hov On Mon, Oct 17, 2016 at 4:28 PM Denis Akhiyarov wrote: > I used ILSPY to inspect your dll and here is how you need to use it (just > tried and it works!): > > In [1]: import clr > > In [2]: import sys > > In [3]: > sys.path.append(r"C:\Users\denis.akhiyarov\Downloads\TestEngine_Compile > ...: d") > > In [4]: clr.AddReference("isc.Eng.Hov") > Out[4]: > > In [5]: import isc.Eng.Hov > > In [6]: from isc.Eng.Hov import * > > On Mon, Oct 17, 2016 at 8:32 AM, Artem Zhukov > wrote: > > Denis, > > 1. from isc.Eng.Hov import * . Result: ImportError: No module named > isc.Eng.Hov > 2. import HovEngine. Result: ImportError: No module named HovEngine > 3. import isc.Eng.Hov.HovEngine. Result: ImportError: No module named > isc.Eng.Hov.HovEngine > 4. from isc.Eng.Hov.HovEngine import *. Result ImportError: No module > named isc.Eng.Hov.HovEngine > > I don't know where the mistake could be hidden. As I see from object > browser the namespace is HovEngine. > [image: unspecified.jpg] > Then, what's wrong? > > On Mon, Oct 17, 2016 at 2:12 PM Denis Akhiyarov > wrote: > > Hi Artem, > > If clr.FindAssembly("isc.Eng.Hov") and clr.AddReference("isc.Eng.Hov") are > working fine, then you need to `import HovEngine`, but not `import > isc.Eng.Hov`. > > This is assuming isc.Eng.Hov is assembly name, and HovEngine is namespace > name. > > Thanks, > Denis > > On Mon, Oct 17, 2016, 12:08 AM Artem Zhukov > wrote: > > Hello all, > please help me to resolve the following problem. I was trying a lot of > things (see 1) and still didn't get it. There is also a project on > freelancer for that (see 2): > > 1. > http://stackoverflow.com/questions/40037684/adding-reference-to-net-assembly-which-has-dots-in-name-and-namespace > 2. https://www.freelancer.com/contest/Write-some-Software-867914.html > > > -- > ARTEM ZHUKOV | HVAC/Mech.Engineer | Building Performance Engineer | > Sustainability Engineer | HVAC TPM | M: +420 774 081 898 <774%20081%20898> > > _________________________________________________ > Python.NET mailing list - PythonDotNet at python.org > https://mail.python.org/mailman/listinfo/pythondotnet > > _________________________________________________ > Python.NET mailing list - PythonDotNet at python.org > https://mail.python.org/mailman/listinfo/pythondotnet > > -- > ARTEM ZHUKOV | HVAC/Mech.Engineer | Building Performance Engineer | > Sustainability Engineer | HVAC TPM | M: +420 774 081 898 > > _________________________________________________ > Python.NET mailing list - PythonDotNet at python.org > https://mail.python.org/mailman/listinfo/pythondotnet > > > _________________________________________________ > Python.NET mailing list - PythonDotNet at python.org > https://mail.python.org/mailman/listinfo/pythondotnet -- ARTEM ZHUKOV | HVAC/Mech.Engineer | Building Performance Engineer | Sustainability Engineer | HVAC TPM | M: +420 774 081 898 -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: unspecified.jpg Type: image/jpeg Size: 6278 bytes Desc: not available URL: From green.azhukov at gmail.com Mon Oct 17 10:57:28 2016 From: green.azhukov at gmail.com (Artem Zhukov) Date: Mon, 17 Oct 2016 14:57:28 +0000 Subject: [Python.NET] Referencing a DLL In-Reply-To: References: Message-ID: In [6]: clr.AddReference("isc.Eng.Hov") Out[6]: In [7]: import isc.Eng.Hov --------------------------------------------------------------------------- ImportError Traceback (most recent call last) in () ----> 1 import isc.Eng.Hov ImportError: No module named isc.Eng.Hov On Mon, Oct 17, 2016 at 4:56 PM Artem Zhukov wrote: > On my machine: > In [6]: clr.AddReference("isc.Eng.Hov") > Out[6]: > > In [7]: import isc.Eng.Hov > --------------------------------------------------------------------------- > ImportError Traceback (most recent call last) > in () > ----> 1 import isc.Eng.Hov > > ImportError: No module named isc.Eng.Hov > > On Mon, Oct 17, 2016 at 4:28 PM Denis Akhiyarov > wrote: > > I used ILSPY to inspect your dll and here is how you need to use it (just > tried and it works!): > > In [1]: import clr > > In [2]: import sys > > In [3]: > sys.path.append(r"C:\Users\denis.akhiyarov\Downloads\TestEngine_Compile > ...: d") > > In [4]: clr.AddReference("isc.Eng.Hov") > Out[4]: > > In [5]: import isc.Eng.Hov > > In [6]: from isc.Eng.Hov import * > > On Mon, Oct 17, 2016 at 8:32 AM, Artem Zhukov > wrote: > > Denis, > > 1. from isc.Eng.Hov import * . Result: ImportError: No module named > isc.Eng.Hov > 2. import HovEngine. Result: ImportError: No module named HovEngine > 3. import isc.Eng.Hov.HovEngine. Result: ImportError: No module named > isc.Eng.Hov.HovEngine > 4. from isc.Eng.Hov.HovEngine import *. Result ImportError: No module > named isc.Eng.Hov.HovEngine > > I don't know where the mistake could be hidden. As I see from object > browser the namespace is HovEngine. > [image: unspecified.jpg] > Then, what's wrong? > > On Mon, Oct 17, 2016 at 2:12 PM Denis Akhiyarov > wrote: > > Hi Artem, > > If clr.FindAssembly("isc.Eng.Hov") and clr.AddReference("isc.Eng.Hov") are > working fine, then you need to `import HovEngine`, but not `import > isc.Eng.Hov`. > > This is assuming isc.Eng.Hov is assembly name, and HovEngine is namespace > name. > > Thanks, > Denis > > On Mon, Oct 17, 2016, 12:08 AM Artem Zhukov > wrote: > > Hello all, > please help me to resolve the following problem. I was trying a lot of > things (see 1) and still didn't get it. There is also a project on > freelancer for that (see 2): > > 1. > http://stackoverflow.com/questions/40037684/adding-reference-to-net-assembly-which-has-dots-in-name-and-namespace > 2. https://www.freelancer.com/contest/Write-some-Software-867914.html > > > -- > ARTEM ZHUKOV | HVAC/Mech.Engineer | Building Performance Engineer | > Sustainability Engineer | HVAC TPM | M: +420 774 081 898 <774%20081%20898> > > _________________________________________________ > Python.NET mailing list - PythonDotNet at python.org > https://mail.python.org/mailman/listinfo/pythondotnet > > _________________________________________________ > Python.NET mailing list - PythonDotNet at python.org > https://mail.python.org/mailman/listinfo/pythondotnet > > -- > ARTEM ZHUKOV | HVAC/Mech.Engineer | Building Performance Engineer | > Sustainability Engineer | HVAC TPM | M: +420 774 081 898 > > _________________________________________________ > Python.NET mailing list - PythonDotNet at python.org > https://mail.python.org/mailman/listinfo/pythondotnet > > > _________________________________________________ > Python.NET mailing list - PythonDotNet at python.org > https://mail.python.org/mailman/listinfo/pythondotnet > > -- > ARTEM ZHUKOV | HVAC/Mech.Engineer | Building Performance Engineer | > Sustainability Engineer | HVAC TPM | M: +420 774 081 898 <774%20081%20898> > -- ARTEM ZHUKOV | HVAC/Mech.Engineer | Building Performance Engineer | Sustainability Engineer | HVAC TPM | M: +420 774 081 898 -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: unspecified.jpg Type: image/jpeg Size: 6278 bytes Desc: not available URL: From denis.akhiyarov at gmail.com Mon Oct 17 11:01:57 2016 From: denis.akhiyarov at gmail.com (Denis Akhiyarov) Date: Mon, 17 Oct 2016 10:01:57 -0500 Subject: [Python.NET] Referencing a DLL In-Reply-To: References: Message-ID: are you on Linux and Mono? What python/Mono/pythonnet versions and architecture? On Mon, Oct 17, 2016 at 9:57 AM, Artem Zhukov wrote: > In [6]: clr.AddReference("isc.Eng.Hov") > Out[6]: > > In [7]: import isc.Eng.Hov > ------------------------------------------------------------ > --------------- > ImportError Traceback (most recent call last) > in () > ----> 1 import isc.Eng.Hov > > ImportError: No module named isc.Eng.Hov > > On Mon, Oct 17, 2016 at 4:56 PM Artem Zhukov > wrote: > >> On my machine: >> In [6]: clr.AddReference("isc.Eng.Hov") >> Out[6]: >> >> In [7]: import isc.Eng.Hov >> ------------------------------------------------------------ >> --------------- >> ImportError Traceback (most recent call >> last) >> in () >> ----> 1 import isc.Eng.Hov >> >> ImportError: No module named isc.Eng.Hov >> >> On Mon, Oct 17, 2016 at 4:28 PM Denis Akhiyarov < >> denis.akhiyarov at gmail.com> wrote: >> >> I used ILSPY to inspect your dll and here is how you need to use it (just >> tried and it works!): >> >> In [1]: import clr >> >> In [2]: import sys >> >> In [3]: sys.path.append(r"C:\Users\denis.akhiyarov\Downloads\ >> TestEngine_Compile >> ...: d") >> >> In [4]: clr.AddReference("isc.Eng.Hov") >> Out[4]: >> >> In [5]: import isc.Eng.Hov >> >> In [6]: from isc.Eng.Hov import * >> >> On Mon, Oct 17, 2016 at 8:32 AM, Artem Zhukov >> wrote: >> >> Denis, >> >> 1. from isc.Eng.Hov import * . Result: ImportError: No module named >> isc.Eng.Hov >> 2. import HovEngine. Result: ImportError: No module named HovEngine >> 3. import isc.Eng.Hov.HovEngine. Result: ImportError: No module named >> isc.Eng.Hov.HovEngine >> 4. from isc.Eng.Hov.HovEngine import *. Result ImportError: No module >> named isc.Eng.Hov.HovEngine >> >> I don't know where the mistake could be hidden. As I see from object >> browser the namespace is HovEngine. >> [image: unspecified.jpg] >> Then, what's wrong? >> >> On Mon, Oct 17, 2016 at 2:12 PM Denis Akhiyarov < >> denis.akhiyarov at gmail.com> wrote: >> >> Hi Artem, >> >> If clr.FindAssembly("isc.Eng.Hov") and clr.AddReference("isc.Eng.Hov") >> are working fine, then you need to `import HovEngine`, but not `import >> isc.Eng.Hov`. >> >> This is assuming isc.Eng.Hov is assembly name, and HovEngine is namespace >> name. >> >> Thanks, >> Denis >> >> On Mon, Oct 17, 2016, 12:08 AM Artem Zhukov >> wrote: >> >> Hello all, >> please help me to resolve the following problem. I was trying a lot of >> things (see 1) and still didn't get it. There is also a project on >> freelancer for that (see 2): >> >> 1. http://stackoverflow.com/questions/40037684/adding- >> reference-to-net-assembly-which-has-dots-in-name-and-namespace >> >> 2. https://www.freelancer.com/contest/Write-some-Software-867914.html >> >> >> -- >> ARTEM ZHUKOV | HVAC/Mech.Engineer | Building Performance Engineer | >> Sustainability Engineer | HVAC TPM | M: +420 774 081 898 >> <774%20081%20898> >> >> _________________________________________________ >> Python.NET mailing list - PythonDotNet at python.org >> https://mail.python.org/mailman/listinfo/pythondotnet >> >> _________________________________________________ >> Python.NET mailing list - PythonDotNet at python.org >> https://mail.python.org/mailman/listinfo/pythondotnet >> >> -- >> ARTEM ZHUKOV | HVAC/Mech.Engineer | Building Performance Engineer | >> Sustainability Engineer | HVAC TPM | M: +420 774 081 898 >> >> _________________________________________________ >> Python.NET mailing list - PythonDotNet at python.org >> https://mail.python.org/mailman/listinfo/pythondotnet >> >> >> _________________________________________________ >> Python.NET mailing list - PythonDotNet at python.org >> https://mail.python.org/mailman/listinfo/pythondotnet >> >> -- >> ARTEM ZHUKOV | HVAC/Mech.Engineer | Building Performance Engineer | >> Sustainability Engineer | HVAC TPM | M: +420 774 081 898 >> <774%20081%20898> >> > -- > ARTEM ZHUKOV | HVAC/Mech.Engineer | Building Performance Engineer | > Sustainability Engineer | HVAC TPM | M: +420 774 081 898 > > _________________________________________________ > Python.NET mailing list - PythonDotNet at python.org > https://mail.python.org/mailman/listinfo/pythondotnet > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: unspecified.jpg Type: image/jpeg Size: 6278 bytes Desc: not available URL: From green.azhukov at gmail.com Mon Oct 17 11:55:20 2016 From: green.azhukov at gmail.com (Artem Zhukov) Date: Mon, 17 Oct 2016 15:55:20 +0000 Subject: [Python.NET] Referencing a DLL In-Reply-To: References: Message-ID: Ubuntu 16.4, Python 2.7.12 Mono 4.2.4 (I used this to install https://github.com/pythonnet/pythonnet/blob/master/.travis.yml) pythonnet (2.2.0.dev1) pythonnet is working correctly. I have another DLL and I able to refer to it with no problems On Mon, Oct 17, 2016 at 5:02 PM Denis Akhiyarov wrote: > are you on Linux and Mono? What python/Mono/pythonnet versions and > architecture? > > On Mon, Oct 17, 2016 at 9:57 AM, Artem Zhukov > wrote: > > In [6]: clr.AddReference("isc.Eng.Hov") > Out[6]: > > In [7]: import isc.Eng.Hov > --------------------------------------------------------------------------- > ImportError Traceback (most recent call last) > in () > ----> 1 import isc.Eng.Hov > > ImportError: No module named isc.Eng.Hov > > On Mon, Oct 17, 2016 at 4:56 PM Artem Zhukov > wrote: > > On my machine: > In [6]: clr.AddReference("isc.Eng.Hov") > Out[6]: > > In [7]: import isc.Eng.Hov > --------------------------------------------------------------------------- > ImportError Traceback (most recent call last) > in () > ----> 1 import isc.Eng.Hov > > ImportError: No module named isc.Eng.Hov > > On Mon, Oct 17, 2016 at 4:28 PM Denis Akhiyarov > wrote: > > I used ILSPY to inspect your dll and here is how you need to use it (just > tried and it works!): > > In [1]: import clr > > In [2]: import sys > > In [3]: > sys.path.append(r"C:\Users\denis.akhiyarov\Downloads\TestEngine_Compile > ...: d") > > In [4]: clr.AddReference("isc.Eng.Hov") > Out[4]: > > In [5]: import isc.Eng.Hov > > In [6]: from isc.Eng.Hov import * > > On Mon, Oct 17, 2016 at 8:32 AM, Artem Zhukov > wrote: > > Denis, > > 1. from isc.Eng.Hov import * . Result: ImportError: No module named > isc.Eng.Hov > 2. import HovEngine. Result: ImportError: No module named HovEngine > 3. import isc.Eng.Hov.HovEngine. Result: ImportError: No module named > isc.Eng.Hov.HovEngine > 4. from isc.Eng.Hov.HovEngine import *. Result ImportError: No module > named isc.Eng.Hov.HovEngine > > I don't know where the mistake could be hidden. As I see from object > browser the namespace is HovEngine. > [image: unspecified.jpg] > Then, what's wrong? > > On Mon, Oct 17, 2016 at 2:12 PM Denis Akhiyarov > wrote: > > Hi Artem, > > If clr.FindAssembly("isc.Eng.Hov") and clr.AddReference("isc.Eng.Hov") are > working fine, then you need to `import HovEngine`, but not `import > isc.Eng.Hov`. > > This is assuming isc.Eng.Hov is assembly name, and HovEngine is namespace > name. > > Thanks, > Denis > > On Mon, Oct 17, 2016, 12:08 AM Artem Zhukov > wrote: > > Hello all, > please help me to resolve the following problem. I was trying a lot of > things (see 1) and still didn't get it. There is also a project on > freelancer for that (see 2): > > 1. > http://stackoverflow.com/questions/40037684/adding-reference-to-net-assembly-which-has-dots-in-name-and-namespace > 2. https://www.freelancer.com/contest/Write-some-Software-867914.html > > > -- > ARTEM ZHUKOV | HVAC/Mech.Engineer | Building Performance Engineer | > Sustainability Engineer | HVAC TPM | M: +420 774 081 898 <774%20081%20898> > > _________________________________________________ > Python.NET mailing list - PythonDotNet at python.org > https://mail.python.org/mailman/listinfo/pythondotnet > > _________________________________________________ > Python.NET mailing list - PythonDotNet at python.org > https://mail.python.org/mailman/listinfo/pythondotnet > > -- > ARTEM ZHUKOV | HVAC/Mech.Engineer | Building Performance Engineer | > Sustainability Engineer | HVAC TPM | M: +420 774 081 898 > > _________________________________________________ > Python.NET mailing list - PythonDotNet at python.org > https://mail.python.org/mailman/listinfo/pythondotnet > > > _________________________________________________ > Python.NET mailing list - PythonDotNet at python.org > https://mail.python.org/mailman/listinfo/pythondotnet > > -- > ARTEM ZHUKOV | HVAC/Mech.Engineer | Building Performance Engineer | > Sustainability Engineer | HVAC TPM | M: +420 774 081 898 <774%20081%20898> > > -- > ARTEM ZHUKOV | HVAC/Mech.Engineer | Building Performance Engineer | > Sustainability Engineer | HVAC TPM | M: +420 774 081 898 > > _________________________________________________ > Python.NET mailing list - PythonDotNet at python.org > https://mail.python.org/mailman/listinfo/pythondotnet > > > _________________________________________________ > Python.NET mailing list - PythonDotNet at python.org > https://mail.python.org/mailman/listinfo/pythondotnet -- ARTEM ZHUKOV | HVAC/Mech.Engineer | Building Performance Engineer | Sustainability Engineer | HVAC TPM | M: +420 774 081 898 -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: unspecified.jpg Type: image/jpeg Size: 6278 bytes Desc: not available URL: From denis.akhiyarov at gmail.com Mon Oct 17 16:05:09 2016 From: denis.akhiyarov at gmail.com (Denis Akhiyarov) Date: Mon, 17 Oct 2016 15:05:09 -0500 Subject: [Python.NET] Referencing a DLL In-Reply-To: References: Message-ID: Let me post a quick update based on reply from Artem. I hope that he posts more detailed answer tomorrow. On Linux his DLL was missing some references that are available by default on Windows. Adding this reference fixed his problem. Perhaps we should improve error logging in pythonnet, if this information is available to Mono/.NET runtime. I use fuslogvw.exe on Windows for these assembly binding issues. On Mon, Oct 17, 2016 at 10:55 AM, Artem Zhukov wrote: > Ubuntu 16.4, > Python 2.7.12 > Mono 4.2.4 (I used this to install https://github.com/ > pythonnet/pythonnet/blob/master/.travis.yml) > pythonnet (2.2.0.dev1) > > pythonnet is working correctly. I have another DLL and I able to refer to > it with no problems > > On Mon, Oct 17, 2016 at 5:02 PM Denis Akhiyarov > wrote: > >> are you on Linux and Mono? What python/Mono/pythonnet versions and >> architecture? >> >> On Mon, Oct 17, 2016 at 9:57 AM, Artem Zhukov >> wrote: >> >> In [6]: clr.AddReference("isc.Eng.Hov") >> Out[6]: >> >> In [7]: import isc.Eng.Hov >> ------------------------------------------------------------ >> --------------- >> ImportError Traceback (most recent call >> last) >> in () >> ----> 1 import isc.Eng.Hov >> >> ImportError: No module named isc.Eng.Hov >> >> On Mon, Oct 17, 2016 at 4:56 PM Artem Zhukov >> wrote: >> >> On my machine: >> In [6]: clr.AddReference("isc.Eng.Hov") >> Out[6]: >> >> In [7]: import isc.Eng.Hov >> ------------------------------------------------------------ >> --------------- >> ImportError Traceback (most recent call >> last) >> in () >> ----> 1 import isc.Eng.Hov >> >> ImportError: No module named isc.Eng.Hov >> >> On Mon, Oct 17, 2016 at 4:28 PM Denis Akhiyarov < >> denis.akhiyarov at gmail.com> wrote: >> >> I used ILSPY to inspect your dll and here is how you need to use it (just >> tried and it works!): >> >> In [1]: import clr >> >> In [2]: import sys >> >> In [3]: sys.path.append(r"C:\Users\denis.akhiyarov\Downloads\ >> TestEngine_Compile >> ...: d") >> >> In [4]: clr.AddReference("isc.Eng.Hov") >> Out[4]: >> >> In [5]: import isc.Eng.Hov >> >> In [6]: from isc.Eng.Hov import * >> >> On Mon, Oct 17, 2016 at 8:32 AM, Artem Zhukov >> wrote: >> >> Denis, >> >> 1. from isc.Eng.Hov import * . Result: ImportError: No module named >> isc.Eng.Hov >> 2. import HovEngine. Result: ImportError: No module named HovEngine >> 3. import isc.Eng.Hov.HovEngine. Result: ImportError: No module named >> isc.Eng.Hov.HovEngine >> 4. from isc.Eng.Hov.HovEngine import *. Result ImportError: No module >> named isc.Eng.Hov.HovEngine >> >> I don't know where the mistake could be hidden. As I see from object >> browser the namespace is HovEngine. >> [image: unspecified.jpg] >> Then, what's wrong? >> >> On Mon, Oct 17, 2016 at 2:12 PM Denis Akhiyarov < >> denis.akhiyarov at gmail.com> wrote: >> >> Hi Artem, >> >> If clr.FindAssembly("isc.Eng.Hov") and clr.AddReference("isc.Eng.Hov") >> are working fine, then you need to `import HovEngine`, but not `import >> isc.Eng.Hov`. >> >> This is assuming isc.Eng.Hov is assembly name, and HovEngine is namespace >> name. >> >> Thanks, >> Denis >> >> On Mon, Oct 17, 2016, 12:08 AM Artem Zhukov >> wrote: >> >> Hello all, >> please help me to resolve the following problem. I was trying a lot of >> things (see 1) and still didn't get it. There is also a project on >> freelancer for that (see 2): >> >> 1. http://stackoverflow.com/questions/40037684/adding- >> reference-to-net-assembly-which-has-dots-in-name-and-namespace >> >> 2. https://www.freelancer.com/contest/Write-some-Software-867914.html >> >> >> -- >> ARTEM ZHUKOV | HVAC/Mech.Engineer | Building Performance Engineer | >> Sustainability Engineer | HVAC TPM | M: +420 774 081 898 >> <774%20081%20898> >> >> _________________________________________________ >> Python.NET mailing list - PythonDotNet at python.org >> https://mail.python.org/mailman/listinfo/pythondotnet >> >> _________________________________________________ >> Python.NET mailing list - PythonDotNet at python.org >> https://mail.python.org/mailman/listinfo/pythondotnet >> >> -- >> ARTEM ZHUKOV | HVAC/Mech.Engineer | Building Performance Engineer | >> Sustainability Engineer | HVAC TPM | M: +420 774 081 898 >> >> _________________________________________________ >> Python.NET mailing list - PythonDotNet at python.org >> https://mail.python.org/mailman/listinfo/pythondotnet >> >> >> _________________________________________________ >> Python.NET mailing list - PythonDotNet at python.org >> https://mail.python.org/mailman/listinfo/pythondotnet >> >> -- >> ARTEM ZHUKOV | HVAC/Mech.Engineer | Building Performance Engineer | >> Sustainability Engineer | HVAC TPM | M: +420 774 081 898 >> <774%20081%20898> >> >> -- >> ARTEM ZHUKOV | HVAC/Mech.Engineer | Building Performance Engineer | >> Sustainability Engineer | HVAC TPM | M: +420 774 081 898 >> >> _________________________________________________ >> Python.NET mailing list - PythonDotNet at python.org >> https://mail.python.org/mailman/listinfo/pythondotnet >> >> >> _________________________________________________ >> Python.NET mailing list - PythonDotNet at python.org >> https://mail.python.org/mailman/listinfo/pythondotnet > > -- > ARTEM ZHUKOV | HVAC/Mech.Engineer | Building Performance Engineer | > Sustainability Engineer | HVAC TPM | M: +420 774 081 898 > > _________________________________________________ > Python.NET mailing list - PythonDotNet at python.org > https://mail.python.org/mailman/listinfo/pythondotnet > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: unspecified.jpg Type: image/jpeg Size: 6278 bytes Desc: not available URL: From green.azhukov at gmail.com Tue Oct 18 00:46:07 2016 From: green.azhukov at gmail.com (Artem Zhukov) Date: Tue, 18 Oct 2016 04:46:07 +0000 Subject: [Python.NET] Referencing a DLL In-Reply-To: References: Message-ID: Hello, the solution was to use [ILSPY](http://ilspy.net/) to investigate the DLL and find dependencies (right click recursively for each DLL). Then I copied all the dependencies to the same folder where the main DLL was. After that, I ran:
print [a for a in clr.ListAssemblies(False)
and get the list of dependencies which are actually involved:
u'isc.Eng.Hov', u'Microsoft.VisualBasic', u'System.Windows.Forms',
u'System.Drawing', u'Accessibility'
and left them in the folder. After doing so the part of code:
sys.path.append(assemblyPath)

clr.AddReference("isc.Eng.Hov")

import isc.Eng.Hov as isk
from isk import *
started work. Thank you, Denis, for help! On Mon, Oct 17, 2016 at 5:55 PM Artem Zhukov wrote: > Ubuntu 16.4, > Python 2.7.12 > Mono 4.2.4 (I used this to install > https://github.com/pythonnet/pythonnet/blob/master/.travis.yml) > pythonnet (2.2.0.dev1) > > pythonnet is working correctly. I have another DLL and I able to refer to > it with no problems > > On Mon, Oct 17, 2016 at 5:02 PM Denis Akhiyarov > wrote: > > are you on Linux and Mono? What python/Mono/pythonnet versions and > architecture? > > On Mon, Oct 17, 2016 at 9:57 AM, Artem Zhukov > wrote: > > In [6]: clr.AddReference("isc.Eng.Hov") > Out[6]: > > In [7]: import isc.Eng.Hov > --------------------------------------------------------------------------- > ImportError Traceback (most recent call last) > in () > ----> 1 import isc.Eng.Hov > > ImportError: No module named isc.Eng.Hov > > On Mon, Oct 17, 2016 at 4:56 PM Artem Zhukov > wrote: > > On my machine: > In [6]: clr.AddReference("isc.Eng.Hov") > Out[6]: > > In [7]: import isc.Eng.Hov > --------------------------------------------------------------------------- > ImportError Traceback (most recent call last) > in () > ----> 1 import isc.Eng.Hov > > ImportError: No module named isc.Eng.Hov > > On Mon, Oct 17, 2016 at 4:28 PM Denis Akhiyarov > wrote: > > I used ILSPY to inspect your dll and here is how you need to use it (just > tried and it works!): > > In [1]: import clr > > In [2]: import sys > > In [3]: > sys.path.append(r"C:\Users\denis.akhiyarov\Downloads\TestEngine_Compile > ...: d") > > In [4]: clr.AddReference("isc.Eng.Hov") > Out[4]: > > In [5]: import isc.Eng.Hov > > In [6]: from isc.Eng.Hov import * > > On Mon, Oct 17, 2016 at 8:32 AM, Artem Zhukov > wrote: > > Denis, > > 1. from isc.Eng.Hov import * . Result: ImportError: No module named > isc.Eng.Hov > 2. import HovEngine. Result: ImportError: No module named HovEngine > 3. import isc.Eng.Hov.HovEngine. Result: ImportError: No module named > isc.Eng.Hov.HovEngine > 4. from isc.Eng.Hov.HovEngine import *. Result ImportError: No module > named isc.Eng.Hov.HovEngine > > I don't know where the mistake could be hidden. As I see from object > browser the namespace is HovEngine. > [image: unspecified.jpg] > Then, what's wrong? > > On Mon, Oct 17, 2016 at 2:12 PM Denis Akhiyarov > wrote: > > Hi Artem, > > If clr.FindAssembly("isc.Eng.Hov") and clr.AddReference("isc.Eng.Hov") are > working fine, then you need to `import HovEngine`, but not `import > isc.Eng.Hov`. > > This is assuming isc.Eng.Hov is assembly name, and HovEngine is namespace > name. > > Thanks, > Denis > > On Mon, Oct 17, 2016, 12:08 AM Artem Zhukov > wrote: > > Hello all, > please help me to resolve the following problem. I was trying a lot of > things (see 1) and still didn't get it. There is also a project on > freelancer for that (see 2): > > 1. > http://stackoverflow.com/questions/40037684/adding-reference-to-net-assembly-which-has-dots-in-name-and-namespace > 2. https://www.freelancer.com/contest/Write-some-Software-867914.html > > > -- > ARTEM ZHUKOV | HVAC/Mech.Engineer | Building Performance Engineer | > Sustainability Engineer | HVAC TPM | M: +420 774 081 898 <774%20081%20898> > > _________________________________________________ > Python.NET mailing list - PythonDotNet at python.org > https://mail.python.org/mailman/listinfo/pythondotnet > > _________________________________________________ > Python.NET mailing list - PythonDotNet at python.org > https://mail.python.org/mailman/listinfo/pythondotnet > > -- > ARTEM ZHUKOV | HVAC/Mech.Engineer | Building Performance Engineer | > Sustainability Engineer | HVAC TPM | M: +420 774 081 898 > > _________________________________________________ > Python.NET mailing list - PythonDotNet at python.org > https://mail.python.org/mailman/listinfo/pythondotnet > > > _________________________________________________ > Python.NET mailing list - PythonDotNet at python.org > https://mail.python.org/mailman/listinfo/pythondotnet > > -- > ARTEM ZHUKOV | HVAC/Mech.Engineer | Building Performance Engineer | > Sustainability Engineer | HVAC TPM | M: +420 774 081 898 <774%20081%20898> > > -- > ARTEM ZHUKOV | HVAC/Mech.Engineer | Building Performance Engineer | > Sustainability Engineer | HVAC TPM | M: +420 774 081 898 > > _________________________________________________ > Python.NET mailing list - PythonDotNet at python.org > https://mail.python.org/mailman/listinfo/pythondotnet > > > _________________________________________________ > Python.NET mailing list - PythonDotNet at python.org > https://mail.python.org/mailman/listinfo/pythondotnet > > -- > ARTEM ZHUKOV | HVAC/Mech.Engineer | Building Performance Engineer | > Sustainability Engineer | HVAC TPM | M: +420 774 081 898 <774%20081%20898> > -- ARTEM ZHUKOV | HVAC/Mech.Engineer | Building Performance Engineer | Sustainability Engineer | HVAC TPM | M: +420 774 081 898 -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: unspecified.jpg Type: image/jpeg Size: 6278 bytes Desc: not available URL: From Kresimir.Simunic at Reicofil.com Tue Oct 18 09:45:10 2016 From: Kresimir.Simunic at Reicofil.com (Simunic,Kresimir) Date: Tue, 18 Oct 2016 13:45:10 +0000 Subject: [Python.NET] PythonEngine.ImportModule(..) Message-ID: <140586760BB9EB4B915EB258E3CFB7C001109DE6F0@VM-Server78.local.reifenhauser.com> Hello, When using PythonEngine.ImportModule(..) function, the function returns NULL meaning there was some Exception during import. Is there a way to get description of this Error ? Could you point me to good manual and examples for using Python for .NET ? Thank you, Kresimir Simunic. [cid:k2016_email_footer_200x78.jpg] Reifenh?user Reicofil GmbH & Co. KG Spicher Stra?e 46, 53844 Troisdorf, Germany Registergericht Siegburg, Reg.Nr. HR A 4534 USt-IdNr. DE 814359351, Steuer-Nr. 5220/5760/0426 Reifenh?user Reicofil Verwaltungs-GmbH Registergericht Siegburg, Reg.Nr. HR B 788 Gesch?ftsf?hrer: Dr.-Ing. Bernd Kunze Please note: This message may contain information which is privileged, confidential and proprietary. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: k2016_email_footer_200x78.jpg Type: application/octet-stream Size: 23808 bytes Desc: k2016_email_footer_200x78.jpg URL: From denis.akhiyarov at gmail.com Tue Oct 18 10:08:27 2016 From: denis.akhiyarov at gmail.com (Denis Akhiyarov) Date: Tue, 18 Oct 2016 09:08:27 -0500 Subject: [Python.NET] PythonEngine.ImportModule(..) In-Reply-To: <140586760BB9EB4B915EB258E3CFB7C001109DE6F0@VM-Server78.local.reifenhauser.com> References: <140586760BB9EB4B915EB258E3CFB7C001109DE6F0@VM-Server78.local.reifenhauser.com> Message-ID: It looks like we have 2 open issues about providing more error content during import failures: https://github.com/pythonnet/pythonnet/issues/111 https://github.com/pythonnet/pythonnet/issues/261 I usually troubleshoot by trying normal import of this module in python and then attaching the debugger. We recently updated the documentation, there is also short tutorial and wiki: http://pythonnet.github.io/readme.html https://github.com/pythonnet/pythonnet/blob/master/README.md https://github.com/pythonnet/pythonnet/wiki Cheers, Denis On Tue, Oct 18, 2016 at 8:45 AM, Simunic,Kresimir < Kresimir.Simunic at reicofil.com> wrote: > Hello, > > > > When using PythonEngine.ImportModule(..) function, the function returns > NULL meaning there was some Exception during import. > > > > Is there a way to get description of this Error ? > > > > Could you point me to good manual and examples for using Python for .NET ? > > > > Thank you, > > > > Kresimir Simunic. > > > > > > > > *Reifenh?user Reicofil GmbH & Co. KG* > Spicher Stra?e 46, 53844 Troisdorf, Germany > Registergericht Siegburg, Reg.Nr. HR A 4534 > USt-IdNr. DE 814359351, Steuer-Nr. 5220/5760/0426 > Reifenh?user Reicofil Verwaltungs-GmbH > Registergericht Siegburg, Reg.Nr. HR B 788 > Gesch?ftsf?hrer: Dr.-Ing. Bernd Kunze > > Please note: This message may contain information which is privileged, > confidential and proprietary. > > > > _________________________________________________ > Python.NET mailing list - PythonDotNet at python.org > https://mail.python.org/mailman/listinfo/pythondotnet > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: k2016_email_footer_200x78.jpg Type: application/octet-stream Size: 23808 bytes Desc: not available URL: From Kresimir.Simunic at Reicofil.com Tue Oct 18 11:05:36 2016 From: Kresimir.Simunic at Reicofil.com (Simunic,Kresimir) Date: Tue, 18 Oct 2016 15:05:36 +0000 Subject: [Python.NET] Python for .NET advantages Message-ID: <140586760BB9EB4B915EB258E3CFB7C001109DE796@VM-Server78.local.reifenhauser.com> Hello all, I have Python script that basically has 3 functions, two of them I am calling only once in beginning, and one function I call regularly let's say every second. All functions are of type to have some parameters and give back result without some state being saved between call. I realized this calls using Python for .NET. But, now I ask myself if I have any real advantage comparing scenario in which I would call python interpreter from C# program directly, then python program would store result in txt file and I would read it from C# program. Can someone tell me what would be disadvantage of such approach ? Ok, I can imagine parameter transfer is more complicated, exception handling probably also, maybe python also would need more time to perform this functions because of some initialization methods that it would have to repeat each time python interpreter is called ? Thanks, Regards. Kresimir Simunic. -- [cid:k2016_email_footer_200x78.jpg] Reifenh?user Reicofil GmbH & Co. KG Spicher Stra?e 46, 53844 Troisdorf, Germany Registergericht Siegburg, Reg.Nr. HR A 4534 USt-IdNr. DE 814359351, Steuer-Nr. 5220/5760/0426 Reifenh?user Reicofil Verwaltungs-GmbH Registergericht Siegburg, Reg.Nr. HR B 788 Gesch?ftsf?hrer: Dr.-Ing. Bernd Kunze Please note: This message may contain information which is privileged, confidential and proprietary. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: k2016_email_footer_200x78.jpg Type: application/octet-stream Size: 23808 bytes Desc: k2016_email_footer_200x78.jpg URL: From PythonDotNet at jnpcarole.com Thu Oct 20 13:38:28 2016 From: PythonDotNet at jnpcarole.com (pythondotnet) Date: Thu, 20 Oct 2016 10:38:28 -0700 Subject: [Python.NET] Support for CLR4 .NET Remoting In-Reply-To: Message-ID: <20161020103828.3e63f68611bc0deecd5a6dd5fef89a2f.fe160eb814.mailapi@email09.godaddy.com> Does pythonnet-2.1.0 support .NET Remoting? When I try to get an interface, python 2.7 crashes: Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object. at Python.Runtime.ClassDerivedObject.ToPython(IPythonDerivedType obj) at Python.Runtime.Converter.ToPython(Object value, Type type) at Python.Runtime.MethodBinder.Invoke(IntPtr inst, IntPtr args, IntPtr kw, MethodBase info, MethodInfo[] methodinfo) at Python.Runtime.MethodObject.Invoke(IntPtr target, IntPtr args, IntPtr kw,MethodBase info) at Python.Runtime.MethodBinding.tp_call(IntPtr ob, IntPtr args, IntPtr kw) It's getting past these lines in my script: import clr clr.Addreference(my remoting DLL) from MyNamespace import * and choking on a static method in my app's remoting DLL call which returns the interface. Through logging, I can tell that the code in that static method call is successfully executing: (IMyInterface)Activator.GetObject(typeof(IMyInterface), url); and returning the object back to Python. This worked fine before when my app targeted .NET 3.5 and I used the CLR2 version of the Python for .NET package. Now my app targets .NET 4.5.2 so I: - Updated to Python 2.7.12 - Updated the copy of my app's remoting DLL in c:\python27\dll - Removed the old Python for .NET package - Executed "pip install pythonnet", which gave me version 2.1.0. In C:\Python27\Lib\site-packages\ I see: clr.pyd Python.Runtime.dll v 2.0.0.2 Python.Runtime.dll.config -------------- next part -------------- An HTML attachment was scrubbed... URL: From denis.akhiyarov at gmail.com Thu Oct 20 14:01:48 2016 From: denis.akhiyarov at gmail.com (Denis Akhiyarov) Date: Thu, 20 Oct 2016 13:01:48 -0500 Subject: [Python.NET] Support for CLR4 .NET Remoting In-Reply-To: <20161020103828.3e63f68611bc0deecd5a6dd5fef89a2f.fe160eb814.mailapi@email09.godaddy.com> References: <20161020103828.3e63f68611bc0deecd5a6dd5fef89a2f.fe160eb814.mailapi@email09.godaddy.com> Message-ID: Can you provide minimal reproducible code sample for both C# and Python? What is the latest pythonnet version in which this works? Are you testing this from interactive python or ipython? There are some differences between the 2 options. Please also open an issue on github. BTW, why have you not switched to WCF? Thanks, Denis -------------- next part -------------- An HTML attachment was scrubbed... URL: From PythonDotNet at jnpcarole.com Mon Oct 24 16:32:50 2016 From: PythonDotNet at jnpcarole.com (pythondotnet) Date: Mon, 24 Oct 2016 13:32:50 -0700 Subject: [Python.NET] Support for CLR4 .NET Remoting In-Reply-To: Message-ID: <20161024133250.3e63f68611bc0deecd5a6dd5fef89a2f.641395d78a.mailapi@email09.godaddy.com> > Can you provide minimal reproducible code sample for both C# and Python? Tried uploading a .zip file to GitHub but got error "We don't support that file type." Instead I put a dropbox file link in the issue. > What is the latest pythonnet version in which this works? I only ever used pythonnet-2.0-alpha2-clr2.0_131_py27_UCS2 with Python 2.7.2, where it worked when controlling my .Net 3.5-based-based GUI app. I only updated my app to .NET 4.5.2 last week, which is the first time I tried CLR4-compatible PythonDotNet with Python 2.7.12. > Are you testing this from interactive python or ipython? There are some differences between the 2 options. - Command shell: C:\Python27> python my.py > Please also open an issue on github. Done: ".NET Remoting support broken #276" > BTW, why have you not switched to WCF? - Yeah, I know, Remoting is deprecated : ( Need to learn about WCF and see what kind of pain it will cause my long-established user base. --------- Original Message --------- Subject: PythonDotNet Digest, Vol 147, Issue 18 From: pythondotnet-request at python.org Date: 10/21/16 10:00 am To: pythondotnet at python.org Send PythonDotNet mailing list submissions to pythondotnet at python.org To subscribe or unsubscribe via the World Wide Web, visit https://mail.python.org/mailman/listinfo/pythondotnet or, via email, send a message with subject or body 'help' to pythondotnet-request at python.org You can reach the person managing the list at pythondotnet-owner at python.org When replying, please edit your Subject line so it is more specific than "Re: Contents of PythonDotNet digest..." Today's Topics: 1. Support for CLR4 .NET Remoting (pythondotnet) 2. Re: Support for CLR4 .NET Remoting (Denis Akhiyarov) ---------------------------------------------------------------------- Message: 1 Date: Thu, 20 Oct 2016 10:38:28 -0700 From: "pythondotnet" To: pythondotnet at python.org Subject: [Python.NET] Support for CLR4 .NET Remoting Message-ID: <20161020103828.3e63f68611bc0deecd5a6dd5fef89a2f.fe160eb814.mailapi at email09.godaddy.com> Content-Type: text/plain; charset="utf-8" Does pythonnet-2.1.0 support .NET Remoting? When I try to get an interface, python 2.7 crashes: Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object. at Python.Runtime.ClassDerivedObject.ToPython(IPythonDerivedType obj) at Python.Runtime.Converter.ToPython(Object value, Type type) at Python.Runtime.MethodBinder.Invoke(IntPtr inst, IntPtr args, IntPtr kw, MethodBase info, MethodInfo[] methodinfo) at Python.Runtime.MethodObject.Invoke(IntPtr target, IntPtr args, IntPtr kw,MethodBase info) at Python.Runtime.MethodBinding.tp_call(IntPtr ob, IntPtr args, IntPtr kw) It's getting past these lines in my script: import clr clr.Addreference(my remoting DLL) from MyNamespace import * and choking on a static method in my app's remoting DLL call which returns the interface. Through logging, I can tell that the code in that static method call is successfully executing: (IMyInterface)Activator.GetObject(typeof(IMyInterface), url); and returning the object back to Python. This worked fine before when my app targeted .NET 3.5 and I used the CLR2 version of the Python for .NET package. Now my app targets .NET 4.5.2 so I: - Updated to Python 2.7.12 - Updated the copy of my app's remoting DLL in c:\python27\dll - Removed the old Python for .NET package - Executed "pip install pythonnet", which gave me version 2.1.0. In C:\Python27\Lib\site-packages\ I see: clr.pyd Python.Runtime.dll v 2.0.0.2 Python.Runtime.dll.config -------------- next part -------------- An HTML attachment was scrubbed... URL: ------------------------------ Message: 2 Date: Thu, 20 Oct 2016 13:01:48 -0500 From: Denis Akhiyarov To: "A list for users and developers of Python for .NET" Subject: Re: [Python.NET] Support for CLR4 .NET Remoting Message-ID: Content-Type: text/plain; charset="utf-8" Can you provide minimal reproducible code sample for both C# and Python? What is the latest pythonnet version in which this works? Are you testing this from interactive python or ipython? There are some differences between the 2 options. Please also open an issue on github. BTW, why have you not switched to WCF? Thanks, Denis -------------- next part -------------- An HTML attachment was scrubbed... URL: ------------------------------ Subject: Digest Footer _______________________________________________ PythonDotNet mailing list PythonDotNet at python.org https://mail.python.org/mailman/listinfo/pythondotnet ------------------------------ End of PythonDotNet Digest, Vol 147, Issue 18 ********************************************* -------------- next part -------------- An HTML attachment was scrubbed... URL: From denis.akhiyarov at gmail.com Wed Oct 26 14:26:18 2016 From: denis.akhiyarov at gmail.com (Denis Akhiyarov) Date: Wed, 26 Oct 2016 13:26:18 -0500 Subject: [Python.NET] advanced book about Python In-Reply-To: References: Message-ID: I'm looking for 2 more contributors before purchasing the book. Please let me know! By pythonnet contributor I really mean anyone who contributed not only code but also pythonnet issues or wiki. Here is the list of current contributors: dta at dta-Inspiron-N5050 ~ $ octohatrack pythonnet/pythonnet Collecting API contributors... Collecting all repo contributors.................. ............................................................ ............................................................ ............................................................ ............................................................ ............................................................ ............................................................ ............................................................ ............................................................ ............................................................ ............................................................ ............................................................ ............................................................ ............................................................ ............................................................ ..................................................... Collecting wiki contributors..... Collecting CONTRIBUTORS file...No CONTRIBUTORS file GitHub Contributors: BartonCline brianlloyd (Brian Lloyd) davidanthoff (David Anthoff) denfromufa dgsantana (Daniel Santana) dlech (David Lechner) fdanny filmor (Benedikt Reinartz) hsoft (Virgil Dupras) jfrayne johnburnett (John Burnett) leith-bartrich (Bradley Friedman) lstratman (Luke Stratman) matthid (Matthias Dittrich) omnicognate patstew rico-chet rnestler (Raphael Nestler) sdpython (xavier dupr?) stonebig sweinst swinstanley (Sam Winstanley) t3476 (He-chien Tsai) tiran (Christian Heimes) tonyroberts (Tony Roberts) vmuriart (Vik) zanedp (Zane D. Purvis) All Contributors: adamklein (Adam Klein) AlexCatarino (Alexandre Catarino) Alvarz (Carlos Alvarez) andygraham anntzer (Antony Lee) aolney (Andrew M Olney) aPere3 (Alex, P?r?) ArvidJB BartonCline bastelflp (Philipp Huebner) bc3tech (Brandon H) bltribble brianlloyd (Brian Lloyd) BrisingrAerowing (Brisingr Aerowing) ChristopherHoward chunyisong colbyj (Colby Johanson) curzona (Aron Curzon) dandersson danic (Dani Carles) davidanthoff (David Anthoff) dgsantana (Daniel Santana) dhirschfeld (Dave Hirschfeld) dlech (David Lechner) dmitriyse dmitry-a-morozov (Dmitry Morozov) eisenheimjelid (Jelid Leon) electronicpatterns (Alexander McLin) fdanny filmor (Benedikt Reinartz) freakboy3742 (Russell Keith-Magee) FredChauviere galpin gatapia (Guido Tapia) ghost (Deleted user) gnychis (George Nychis) hognala (Alan Copeland) hsoft (Virgil Dupras) Ijwu (Hussein Farran) jfbramboll (Jason Boileau) jfrayne JimSEOW (JimSw2016) jnkramer3 johnburnett (John Burnett) jomido (Jonathan Dobson) jonnojohnson JosefNemec (Josef Nemec) josselex karbon62 (Lisa Van Sau) karmakat (Aleks Berland) kelvinomolumo kuraga (Alexander Kurakin) laomagege laurentbeaumer (Laurent Beaumer) lcorrigan leith-bartrich (Bradley Friedman) leomeuk (Leo) letianzj (Letian) LinJianping lstratman (Luke Stratman) mackim83 (Mac Kim) mahibra maksimlinio (Maksim K) mateuszlewko matthid (Matthias Dittrich) mikofski (Mark Mikofski) minxomat (311ba2 5453bf) mozey (Christiaan van Zyl) mx (Morgon Kanter) nikhil003 (Nikhil Garg) npezolano (Nicholas Pezolano) omnicognate oysols patstew rico-chet rihardsk (Rihards Kri?lauks) rnestler (Raphael Nestler) roarlarsen (Roar Larsen) rogersachan (Roger) royalstream (Steven Burns) rudil sdpython (xavier dupr?) selikhovel shotskii sigbjorn somelinguist spichardo stonebig sweinst swinstanley (Sam Winstanley) t3476 (He-chien Tsai) tactevo (Charley Lanusse) theonewolf (Wolfgang Richter) ThiefMaster (Adrian) Thraka (Andy De George) thu2004 (Thu) tiran (Christian Heimes) tonyroberts (Tony Roberts) uberclops uenz vincenzogis vmuriart (Vik) wagnerpeer wiwat-tharateeraparb (Wiwat Tharateeraparb) yajiedesign (Hu Shiwen) yever (Ya'ar Hever) yuvval zanedp (Zane D. Purvis) zhenghan008 ZhukovGreen zooba (Steve Dower) zwadar Repo: pythonnet/pythonnet GitHub Contributors: 27 All Contributors: 112 Thanks, Denis On Fri, Oct 14, 2016 at 2:09 AM, Pochon-Gu?rin Ludovic < Ludovic.Pochon-Guerin at statkraft.com> wrote: > Yes please, > > > > I want to contribute to get a copy. > > > > Mvh > > Ludovic > > > > *From:* PythonDotNet [mailto:pythondotnet-bounces+ludovic.pochon-guerin= > statkraft.com at python.org] *On Behalf Of *Denis Akhiyarov > *Sent:* 13. oktober 2016 23:39 > *To:* A list for users and developers of Python for .NET > *Subject:* [Python.NET] advanced book about Python > > > > Hi Python and .NET developers, > > > > I would like to purchase a copy of this advanced book about Python for > pythonnet contributors: > > > > https://thehackerguidetopython.com > > > > The cost of professional license to share with 50 people is 199 USD ($), > but I will pay it in full if at least 10 people agree to contribute any > amount towards the full cost. The book is sold for 29$ for one person. > > > > The author agreed to this deal. The author is OpenStack Project Team > Leader and Technical Committee Member. > > > > > > [image: Inline image 1] > > > > Here is a sample chapter about functional programming, comprehensions, and > generators: > > > > https://thehackerguidetopython.com/the-hacker-guide-to-python-sample.pdf > > > > Please reply to me or here if you would like to get this offer! > > > > Thanks, > > Denis > > _________________________________________________ > Python.NET mailing list - PythonDotNet at python.org > https://mail.python.org/mailman/listinfo/pythondotnet > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.png Type: image/png Size: 31643 bytes Desc: not available URL: