From jfburkhart.reg at gmail.com Thu Nov 1 08:28:22 2012 From: jfburkhart.reg at gmail.com (John Burkhart) Date: Thu, 1 Nov 2012 08:28:22 +0100 Subject: [Python.NET] compiling for .NET CLR4, Python 2.7 Message-ID: Thanks for the reply. I only have Visual Studio 2012 available to me... is there a setting somewhere I could play with? I'm new to working with MS Windows and VS... Thank you! -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfburkhart.reg at gmail.com Thu Nov 1 09:54:17 2012 From: jfburkhart.reg at gmail.com (John Burkhart) Date: Thu, 1 Nov 2012 09:54:17 +0100 Subject: [Python.NET] compiling for .NET CLR4, Python 2.7 In-Reply-To: References: Message-ID: Interesting finding... I just uninstalled EPD (Enthought Python Distribution) and installed vanilla Python 2.7 So far it seems all is working. On Tue, Oct 30, 2012 at 9:39 PM, Thomas Stanley-Jones < tstanleyjones at gmail.com> wrote: > I also tried to build on a 64bit Windows 7 machine and was not able to > make it work consistently. I was told that the issue was with the version > of VS that I used to build PythonNet. I am not knowledgeable in this area > however, and could not figure out how to get it to work consistently. I > was trying to use it with a distribution of CPython 2.6 (which caused me > the most trouble) and CPython 2.7. I stopped working on it as I could only > get 2.7 to see the PythonNet module. I'm curious what answers you come up > with as I would still love to get this to work on my machine. > > Thomas > > On Tue, Oct 30, 2012 at 7:19 AM, John Burkhart wrote: > >> Hello, >> >> I'm new to .NET and just trying to make available a few .NET dll files >> for an application I would *like* to build in CPython. I'm trying to use >> pythonnet for the task as I would prefer not to use IronPython. I have >> Python 2.7 installed on a 64bit Windows 7 PC. >> >> I have managed to get the latest svn version, confirmed required changes >> according to: >> http://blog.bidiuk.com/2011/01/python-net-and-vs2010-net-4/ >> >> were made. Though, it seemed most were no longer necessary in the latest >> SVN version. >> >> I also changed the Conditional Compilation symbols to: PYTHON27,UCS2 >> under the Python.Runtime, Properties->Build tab. >> >> I rebuilt the entire solution, and all compiled with no errors. >> >> However, I get the following when I try to run Python.exe: >> >> PS G:\svn\Python\pythonnet\trunk\pythonnet\src\console\bin\Debug> >> .\python.exe >> ImportError: No module named site >> PS G:\svn\Python\pythonnet\trunk\pythonnet\src\console\bin\Debug> >> >> Does anyone have experience building pythonnet for Python 2.7 and .NET 4? >> >> Thank you in advance, >> john >> >> _________________________________________________ >> Python.NET mailing list - PythonDotNet at python.org >> http://mail.python.org/mailman/listinfo/pythondotnet >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfburkhart.reg at gmail.com Fri Nov 2 09:30:45 2012 From: jfburkhart.reg at gmail.com (John Burkhart) Date: Fri, 2 Nov 2012 09:30:45 +0100 Subject: [Python.NET] compiling for .NET CLR4, Python 2.7 In-Reply-To: References: Message-ID: Hello, I have a request into Enthought for some insight on why I would get an "ImportError" for the site module. They've asked that I pose a question to the pythonnet group, and whether anyone knows what custom PATH variables the pythonnet python.exe may be searching? Thank you, john On Thu, Nov 1, 2012 at 9:54 AM, John Burkhart wrote: > Interesting finding... > > I just uninstalled EPD (Enthought Python Distribution) and installed > vanilla Python 2.7 > > So far it seems all is working. > > > On Tue, Oct 30, 2012 at 9:39 PM, Thomas Stanley-Jones < > tstanleyjones at gmail.com> wrote: > >> I also tried to build on a 64bit Windows 7 machine and was not able to >> make it work consistently. I was told that the issue was with the version >> of VS that I used to build PythonNet. I am not knowledgeable in this area >> however, and could not figure out how to get it to work consistently. I >> was trying to use it with a distribution of CPython 2.6 (which caused me >> the most trouble) and CPython 2.7. I stopped working on it as I could only >> get 2.7 to see the PythonNet module. I'm curious what answers you come up >> with as I would still love to get this to work on my machine. >> >> Thomas >> >> On Tue, Oct 30, 2012 at 7:19 AM, John Burkhart wrote: >> >>> Hello, >>> >>> I'm new to .NET and just trying to make available a few .NET dll files >>> for an application I would *like* to build in CPython. I'm trying to use >>> pythonnet for the task as I would prefer not to use IronPython. I have >>> Python 2.7 installed on a 64bit Windows 7 PC. >>> >>> I have managed to get the latest svn version, confirmed required changes >>> according to: >>> http://blog.bidiuk.com/2011/01/python-net-and-vs2010-net-4/ >>> >>> were made. Though, it seemed most were no longer necessary in the latest >>> SVN version. >>> >>> I also changed the Conditional Compilation symbols to: PYTHON27,UCS2 >>> under the Python.Runtime, Properties->Build tab. >>> >>> I rebuilt the entire solution, and all compiled with no errors. >>> >>> However, I get the following when I try to run Python.exe: >>> >>> PS G:\svn\Python\pythonnet\trunk\pythonnet\src\console\bin\Debug> >>> .\python.exe >>> ImportError: No module named site >>> PS G:\svn\Python\pythonnet\trunk\pythonnet\src\console\bin\Debug> >>> >>> Does anyone have experience building pythonnet for Python 2.7 and .NET 4? >>> >>> Thank you in advance, >>> john >>> >>> _________________________________________________ >>> Python.NET mailing list - PythonDotNet at python.org >>> http://mail.python.org/mailman/listinfo/pythondotnet >>> >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfburkhart.reg at gmail.com Fri Nov 2 15:41:45 2012 From: jfburkhart.reg at gmail.com (John Burkhart) Date: Fri, 2 Nov 2012 15:41:45 +0100 Subject: [Python.NET] compiling for .NET CLR4, Python 2.7 In-Reply-To: References: Message-ID: Hello, Final update on this thread. For those interested. I managed to build the svn repo with Visual Studio 2012 and run it under EPD Python. My problems before were simply related to the PYTHONPATH settings under system propoerties and a required reboot to get those settings to register (welcome to windows?). My PYTHONPATH is now: C:\Python27\Libs; C:\Python27\Libs\site-packages I can run the pythonnet python.exe and import python modules such as os, sys, and datetime. I changed all the build environment settings to target .NET 4. as described in my initial post. --john On Fri, Nov 2, 2012 at 9:30 AM, John Burkhart wrote: > Hello, > > I have a request into Enthought for some insight on why I would get an > "ImportError" for the site module. > > They've asked that I pose a question to the pythonnet group, and whether > anyone knows what custom PATH variables the pythonnet python.exe may be > searching? > > Thank you, > john > > > On Thu, Nov 1, 2012 at 9:54 AM, John Burkhart wrote: > >> Interesting finding... >> >> I just uninstalled EPD (Enthought Python Distribution) and installed >> vanilla Python 2.7 >> >> So far it seems all is working. >> >> >> On Tue, Oct 30, 2012 at 9:39 PM, Thomas Stanley-Jones < >> tstanleyjones at gmail.com> wrote: >> >>> I also tried to build on a 64bit Windows 7 machine and was not able to >>> make it work consistently. I was told that the issue was with the version >>> of VS that I used to build PythonNet. I am not knowledgeable in this area >>> however, and could not figure out how to get it to work consistently. I >>> was trying to use it with a distribution of CPython 2.6 (which caused me >>> the most trouble) and CPython 2.7. I stopped working on it as I could only >>> get 2.7 to see the PythonNet module. I'm curious what answers you come up >>> with as I would still love to get this to work on my machine. >>> >>> Thomas >>> >>> On Tue, Oct 30, 2012 at 7:19 AM, John Burkhart >> > wrote: >>> >>>> Hello, >>>> >>>> I'm new to .NET and just trying to make available a few .NET dll files >>>> for an application I would *like* to build in CPython. I'm trying to use >>>> pythonnet for the task as I would prefer not to use IronPython. I have >>>> Python 2.7 installed on a 64bit Windows 7 PC. >>>> >>>> I have managed to get the latest svn version, confirmed required >>>> changes according to: >>>> http://blog.bidiuk.com/2011/01/python-net-and-vs2010-net-4/ >>>> >>>> were made. Though, it seemed most were no longer necessary in the >>>> latest SVN version. >>>> >>>> I also changed the Conditional Compilation symbols to: PYTHON27,UCS2 >>>> under the Python.Runtime, Properties->Build tab. >>>> >>>> I rebuilt the entire solution, and all compiled with no errors. >>>> >>>> However, I get the following when I try to run Python.exe: >>>> >>>> PS G:\svn\Python\pythonnet\trunk\pythonnet\src\console\bin\Debug> >>>> .\python.exe >>>> ImportError: No module named site >>>> PS G:\svn\Python\pythonnet\trunk\pythonnet\src\console\bin\Debug> >>>> >>>> Does anyone have experience building pythonnet for Python 2.7 and .NET >>>> 4? >>>> >>>> Thank you in advance, >>>> john >>>> >>>> _________________________________________________ >>>> Python.NET mailing list - PythonDotNet at python.org >>>> http://mail.python.org/mailman/listinfo/pythondotnet >>>> >>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfburkhart.reg at gmail.com Fri Nov 2 15:55:23 2012 From: jfburkhart.reg at gmail.com (John Burkhart) Date: Fri, 2 Nov 2012 15:55:23 +0100 Subject: [Python.NET] pythonnet and numpy Message-ID: Hello, As mentioned in the other thread, I have built pythonnet with VS2012 for a 64-bit Python installation and using .NET 4 assemblies. Things seem to work well. However, I just tried to `import numpy` and all hell broke loose... the reason I pursued pythonnet was because I thought it would allow me to use the pure CPython modules without needing to rely on any of the modified versions built for IronPython. Below is the PowerShell output from starting EPD and importing numpy and starting pythonnet python.exe and importing numpy. PS G:\svn\Python\pythonnet\trunk\pythonnet\src\console\bin\Debug> python #should load EPD python Enthought Python Distribution -- www.enthought.com Version: 7.3-2 (64-bit) Python 2.7.3 |EPD 7.3-2 (64-bit)| (default, Apr 12 2012, 15:20:16) [MSC v.1500 64 bit (AMD64)] on win32 Type "credits", "demo" or "enthought" for more information. >>> import numpy; print numpy.__version__ 1.6.1 >>> exit() PS G:\svn\Python\pythonnet\trunk\pythonnet\src\console\bin\Debug> .\python.exe Python 2.7.3 (default, Apr 10 2012, 23:24:47) [MSC v.1500 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import numpy [Bang!] - A window opens with TITLE: Microsoft Visual C++ Runtime Library Message: Runtime Error! Program: G:\svn\Python... R6034 An application has made an attempt to load the C runtime library incorrectly Please contact the application's support team for more information """ This is not a lot of information, but maybe someone has some ideas on how to troubleshoot? Thank you, john -------------- next part -------------- An HTML attachment was scrubbed... URL: From brad at fie.us Fri Nov 2 16:42:49 2012 From: brad at fie.us (Bradley Friedman) Date: Fri, 2 Nov 2012 11:42:49 -0400 Subject: [Python.NET] pythonnet and numpy In-Reply-To: References: Message-ID: <26A07ED1-67F7-41AA-B019-A199743C4857@fie.us> That error suggests issues with your path or current directory. Multiple or incompatible dynamic libraries etc. in the path. Generally speaking, pythonnet does work with numpy. Something specific is wrong, loading a dll in a low level manner that msvc is upset. Sent from my iPad On Nov 2, 2012, at 10:55 AM, John Burkhart wrote: > Hello, > > As mentioned in the other thread, I have built pythonnet with VS2012 for a 64-bit Python installation and using .NET 4 assemblies. Things seem to work well. > > However, I just tried to `import numpy` and all hell broke loose... the reason I pursued pythonnet was because I thought it would allow me to use the pure CPython modules without needing to rely on any of the modified versions built for IronPython. Below is the PowerShell output from starting EPD and importing numpy and starting pythonnet python.exe and importing numpy. > > PS G:\svn\Python\pythonnet\trunk\pythonnet\src\console\bin\Debug> python #should load EPD python > Enthought Python Distribution -- www.enthought.com > Version: 7.3-2 (64-bit) > > Python 2.7.3 |EPD 7.3-2 (64-bit)| (default, Apr 12 2012, 15:20:16) [MSC v.1500 64 bit (AMD64)] on win32 > Type "credits", "demo" or "enthought" for more information. > >>> import numpy; print numpy.__version__ > 1.6.1 > >>> exit() > PS G:\svn\Python\pythonnet\trunk\pythonnet\src\console\bin\Debug> .\python.exe > Python 2.7.3 (default, Apr 10 2012, 23:24:47) [MSC v.1500 64 bit (AMD64)] on win32 > Type "help", "copyright", "credits" or "license" for more information. > >>> import numpy > [Bang!] - A window opens with > TITLE: Microsoft Visual C++ Runtime Library > Message: Runtime Error! > > Program: G:\svn\Python... > > R6034 > An application has made an attempt to load the C runtime library incorrectly > Please contact the application's support team for more information > """ > > This is not a lot of information, but maybe someone has some ideas on how to troubleshoot? > > Thank you, > john > > > > > > _________________________________________________ > Python.NET mailing list - PythonDotNet at python.org > http://mail.python.org/mailman/listinfo/pythondotnet -------------- next part -------------- An HTML attachment was scrubbed... URL: From stephenp at otakuworld.com Sat Nov 3 03:48:39 2012 From: stephenp at otakuworld.com (Stephen P. Lepisto) Date: Fri, 02 Nov 2012 19:48:39 -0700 Subject: [Python.NET] pythonnet and numpy In-Reply-To: <26A07ED1-67F7-41AA-B019-A199743C4857@fie.us> References: <26A07ED1-67F7-41AA-B019-A199743C4857@fie.us> Message-ID: <50948607.3070802@otakuworld.com> Make sure you are installing the correct "bitness" of numpy for your install of python (64-bit to 64-bit, 32-bit to 32-bit). On 11/2/2012 8:42 AM, Bradley Friedman wrote: > That error suggests issues with your path or current directory. > Multiple or incompatible dynamic libraries etc. in the path. > Generally speaking, pythonnet does work with numpy. Something > specific is wrong, loading a dll in a low level manner that msvc is > upset. > > Sent from my iPad > > On Nov 2, 2012, at 10:55 AM, John Burkhart > wrote: > >> Hello, >> >> As mentioned in the other thread, I have built pythonnet with VS2012 >> for a 64-bit Python installation and using .NET 4 assemblies. Things >> seem to work well. >> >> However, I just tried to `import numpy` and all hell broke loose... >> the reason I pursued pythonnet was because I thought it would allow >> me to use the pure CPython modules without needing to rely on any of >> the modified versions built for IronPython. Below is the PowerShell >> output from starting EPD and importing numpy and starting pythonnet >> python.exe and importing numpy. >> >> PS G:\svn\Python\pythonnet\trunk\pythonnet\src\console\bin\Debug> >> python #should load EPD python >> Enthought Python Distribution -- www.enthought.com >> >> Version: 7.3-2 (64-bit) >> >> Python 2.7.3 |EPD 7.3-2 (64-bit)| (default, Apr 12 2012, 15:20:16) >> [MSC v.1500 64 bit (AMD64)] on win32 >> Type "credits", "demo" or "enthought" for more information. >> >>> import numpy; print numpy.__version__ >> 1.6.1 >> >>> exit() >> PS G:\svn\Python\pythonnet\trunk\pythonnet\src\console\bin\Debug> >> .\python.exe >> Python 2.7.3 (default, Apr 10 2012, 23:24:47) [MSC v.1500 64 bit >> (AMD64)] on win32 >> Type "help", "copyright", "credits" or "license" for more information. >> >>> import numpy >> [Bang!] - A window opens with >> TITLE: Microsoft Visual C++ Runtime Library >> Message: Runtime Error! >> >> Program: G:\svn\Python... >> >> R6034 >> An application has made an attempt to load the C runtime library >> incorrectly >> Please contact the application's support team for more information >> """ >> >> This is not a lot of information, but maybe someone has some ideas on >> how to troubleshoot? >> >> Thank you, >> john >> >> >> >> >> >> _________________________________________________ >> Python.NET mailing list - PythonDotNet at python.org >> >> http://mail.python.org/mailman/listinfo/pythondotnet > > > _________________________________________________ > Python.NET mailing list - PythonDotNet at python.org > http://mail.python.org/mailman/listinfo/pythondotnet -- Stephen P. Lepisto -------------- next part -------------- An HTML attachment was scrubbed... URL: From brad at fie.us Sat Nov 3 05:13:42 2012 From: brad at fie.us (Bradley Friedman) Date: Sat, 3 Nov 2012 00:13:42 -0400 Subject: [Python.NET] pythonnet and numpy In-Reply-To: <50948607.3070802@otakuworld.com> References: <26A07ED1-67F7-41AA-B019-A199743C4857@fie.us> <50948607.3070802@otakuworld.com> Message-ID: <3A2C13FC-9C4D-4C52-81ED-3FDDF9083C99@fie.us> There is also the ucs-2 versus ucs-4 binary incompatibility. Though that one usually shows up when you call, not when you bind. But then again, I have only kicked that off on unix. On windows it might show up on bind. Not sure. Does numpy import when run from the exact python you are using python.net with? Sent from my iPad On Nov 2, 2012, at 10:48 PM, "Stephen P. Lepisto" wrote: > Make sure you are installing the correct "bitness" of numpy for your install of python (64-bit to 64-bit, 32-bit to 32-bit). > > On 11/2/2012 8:42 AM, Bradley Friedman wrote: >> That error suggests issues with your path or current directory. Multiple or incompatible dynamic libraries etc. in the path. Generally speaking, pythonnet does work with numpy. Something specific is wrong, loading a dll in a low level manner that msvc is upset. >> >> Sent from my iPad >> >> On Nov 2, 2012, at 10:55 AM, John Burkhart wrote: >> >>> Hello, >>> >>> As mentioned in the other thread, I have built pythonnet with VS2012 for a 64-bit Python installation and using .NET 4 assemblies. Things seem to work well. >>> >>> However, I just tried to `import numpy` and all hell broke loose... the reason I pursued pythonnet was because I thought it would allow me to use the pure CPython modules without needing to rely on any of the modified versions built for IronPython. Below is the PowerShell output from starting EPD and importing numpy and starting pythonnet python.exe and importing numpy. >>> >>> PS G:\svn\Python\pythonnet\trunk\pythonnet\src\console\bin\Debug> python #should load EPD python >>> Enthought Python Distribution -- www.enthought.com >>> Version: 7.3-2 (64-bit) >>> >>> Python 2.7.3 |EPD 7.3-2 (64-bit)| (default, Apr 12 2012, 15:20:16) [MSC v.1500 64 bit (AMD64)] on win32 >>> Type "credits", "demo" or "enthought" for more information. >>> >>> import numpy; print numpy.__version__ >>> 1.6.1 >>> >>> exit() >>> PS G:\svn\Python\pythonnet\trunk\pythonnet\src\console\bin\Debug> .\python.exe >>> Python 2.7.3 (default, Apr 10 2012, 23:24:47) [MSC v.1500 64 bit (AMD64)] on win32 >>> Type "help", "copyright", "credits" or "license" for more information. >>> >>> import numpy >>> [Bang!] - A window opens with >>> TITLE: Microsoft Visual C++ Runtime Library >>> Message: Runtime Error! >>> >>> Program: G:\svn\Python... >>> >>> R6034 >>> An application has made an attempt to load the C runtime library incorrectly >>> Please contact the application's support team for more information >>> """ >>> >>> This is not a lot of information, but maybe someone has some ideas on how to troubleshoot? >>> >>> Thank you, >>> john >>> >>> >>> >>> >>> >>> _________________________________________________ >>> Python.NET mailing list - PythonDotNet at python.org >>> http://mail.python.org/mailman/listinfo/pythondotnet >> >> >> _________________________________________________ >> Python.NET mailing list - PythonDotNet at python.org >> http://mail.python.org/mailman/listinfo/pythondotnet > > -- > Stephen P. Lepisto > _________________________________________________ > Python.NET mailing list - PythonDotNet at python.org > http://mail.python.org/mailman/listinfo/pythondotnet -------------- next part -------------- An HTML attachment was scrubbed... URL: From barton at bcdesignswell.com Sun Nov 4 23:44:41 2012 From: barton at bcdesignswell.com (Barton) Date: Sun, 04 Nov 2012 14:44:41 -0800 Subject: [Python.NET] assemblymanager and reflection only assemblies In-Reply-To: <3D258D00-197D-4F63-A172-BF2747A5DF02@fie.us> References: <3D258D00-197D-4F63-A172-BF2747A5DF02@fie.us> Message-ID: <5096EFD9.5070404@bcdesignswell.com> Interesting. I'm planning on having some time freed up for this project and I'll take a look and run unit testing on your suggestion. Thanks. On 10/26/2012 07:38 PM, brad at fie.us wrote: > fyi: I ran into a bug and fixed it? I think? > > Some thoughts on what I did? > > I am writing an application that loads plugins. As part of that, it first loads the plugin assembly in "reflection only" mode. > > pythonnet's assemblymanager.cs registers a handler at line 54. > > it gets called when I load the assembly? even in reflection mode. Which I think is correct. > > the handler begins at line 88. > > it was throwing an exception when it tries to "ScanAssembly()" on the passed assembly. More specifically when it tried to load the types. > > If I'm reading the code right, it should not attempt to scan the assembly because it is loaded reflection only. One can check this with the "ReflectionOnly" property of the provided assembly. So I surrounded the rest of the code in a "if" conditional and only add the assembly and scan it, if it is not "RefelctionOnly." > > Is that the right thing to do? It's gotten rid of my problem. But I wonder if its strictly correct to both not add it to the assemblies collection in the manager and also not scan it. > > Thoughts? I don't want to submit a patch if it's not really the right approach to the matter. > _________________________________________________ > Python.NET mailing list - PythonDotNet at python.org > http://mail.python.org/mailman/listinfo/pythondotnet > From jfburkhart.reg at gmail.com Mon Nov 5 08:50:25 2012 From: jfburkhart.reg at gmail.com (John Burkhart) Date: Mon, 5 Nov 2012 08:50:25 +0100 Subject: [Python.NET] PythonDotNet Digest, Vol 103, Issue 4 In-Reply-To: References: Message-ID: Thanks all for the replies! I've also been in touch with the folks at Enthought, and they provided the idea that has led to me posting a question at StackExchange: http://stackoverflow.com/questions/13222393/compiling-pythonnet-net-to-work-ethought-python-distribution-using-visual-stu I'm pretty sure my bit-to-bit issue is accounted for. I've also used the numpy from EPD in the same python I'm using for pythonnet and that has no problems. As far as the UCS issues, I was only able to build the pythonnet project as UCS-2, if I changed that string to UCS-4 the build crashed... maybe something on windows? Thanks for helping! On Sat, Nov 3, 2012 at 12:00 PM, wrote: > Send PythonDotNet mailing list submissions to > pythondotnet at python.org > > To subscribe or unsubscribe via the World Wide Web, visit > http://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. Re: pythonnet and numpy (Stephen P. Lepisto) > 2. Re: pythonnet and numpy (Bradley Friedman) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Fri, 02 Nov 2012 19:48:39 -0700 > From: "Stephen P. Lepisto" > To: pythondotnet at python.org > Subject: Re: [Python.NET] pythonnet and numpy > Message-ID: <50948607.3070802 at otakuworld.com> > Content-Type: text/plain; charset="iso-8859-1"; Format="flowed" > > Make sure you are installing the correct "bitness" of numpy for your > install of python (64-bit to 64-bit, 32-bit to 32-bit). > > On 11/2/2012 8:42 AM, Bradley Friedman wrote: > > That error suggests issues with your path or current directory. > > Multiple or incompatible dynamic libraries etc. in the path. > > Generally speaking, pythonnet does work with numpy. Something > > specific is wrong, loading a dll in a low level manner that msvc is > > upset. > > > > Sent from my iPad > > > > On Nov 2, 2012, at 10:55 AM, John Burkhart > > wrote: > > > >> Hello, > >> > >> As mentioned in the other thread, I have built pythonnet with VS2012 > >> for a 64-bit Python installation and using .NET 4 assemblies. Things > >> seem to work well. > >> > >> However, I just tried to `import numpy` and all hell broke loose... > >> the reason I pursued pythonnet was because I thought it would allow > >> me to use the pure CPython modules without needing to rely on any of > >> the modified versions built for IronPython. Below is the PowerShell > >> output from starting EPD and importing numpy and starting pythonnet > >> python.exe and importing numpy. > >> > >> PS G:\svn\Python\pythonnet\trunk\pythonnet\src\console\bin\Debug> > >> python #should load EPD python > >> Enthought Python Distribution -- www.enthought.com > >> > >> Version: 7.3-2 (64-bit) > >> > >> Python 2.7.3 |EPD 7.3-2 (64-bit)| (default, Apr 12 2012, 15:20:16) > >> [MSC v.1500 64 bit (AMD64)] on win32 > >> Type "credits", "demo" or "enthought" for more information. > >> >>> import numpy; print numpy.__version__ > >> 1.6.1 > >> >>> exit() > >> PS G:\svn\Python\pythonnet\trunk\pythonnet\src\console\bin\Debug> > >> .\python.exe > >> Python 2.7.3 (default, Apr 10 2012, 23:24:47) [MSC v.1500 64 bit > >> (AMD64)] on win32 > >> Type "help", "copyright", "credits" or "license" for more information. > >> >>> import numpy > >> [Bang!] - A window opens with > >> TITLE: Microsoft Visual C++ Runtime Library > >> Message: Runtime Error! > >> > >> Program: G:\svn\Python... > >> > >> R6034 > >> An application has made an attempt to load the C runtime library > >> incorrectly > >> Please contact the application's support team for more information > >> """ > >> > >> This is not a lot of information, but maybe someone has some ideas on > >> how to troubleshoot? > >> > >> Thank you, > >> john > >> > >> > >> > >> > >> > >> _________________________________________________ > >> Python.NET mailing list - PythonDotNet at python.org > >> > >> http://mail.python.org/mailman/listinfo/pythondotnet > > > > > > _________________________________________________ > > Python.NET mailing list - PythonDotNet at python.org > > http://mail.python.org/mailman/listinfo/pythondotnet > > -- > Stephen P. Lepisto > > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://mail.python.org/pipermail/pythondotnet/attachments/20121102/baeddf76/attachment-0001.html > > > > ------------------------------ > > Message: 2 > Date: Sat, 3 Nov 2012 00:13:42 -0400 > From: Bradley Friedman > To: "Stephen P. Lepisto" > Cc: "pythondotnet at python.org" > Subject: Re: [Python.NET] pythonnet and numpy > Message-ID: <3A2C13FC-9C4D-4C52-81ED-3FDDF9083C99 at fie.us> > Content-Type: text/plain; charset="us-ascii" > > There is also the ucs-2 versus ucs-4 binary incompatibility. Though that > one usually shows up when you call, not when you bind. But then again, I > have only kicked that off on unix. On windows it might show up on bind. Not > sure. Does numpy import when run from the exact python you are using > python.net with? > > Sent from my iPad > > On Nov 2, 2012, at 10:48 PM, "Stephen P. Lepisto" > wrote: > > > Make sure you are installing the correct "bitness" of numpy for your > install of python (64-bit to 64-bit, 32-bit to 32-bit). > > > > On 11/2/2012 8:42 AM, Bradley Friedman wrote: > >> That error suggests issues with your path or current directory. > Multiple or incompatible dynamic libraries etc. in the path. Generally > speaking, pythonnet does work with numpy. Something specific is wrong, > loading a dll in a low level manner that msvc is upset. > >> > >> Sent from my iPad > >> > >> On Nov 2, 2012, at 10:55 AM, John Burkhart > wrote: > >> > >>> Hello, > >>> > >>> As mentioned in the other thread, I have built pythonnet with VS2012 > for a 64-bit Python installation and using .NET 4 assemblies. Things seem > to work well. > >>> > >>> However, I just tried to `import numpy` and all hell broke loose... > the reason I pursued pythonnet was because I thought it would allow me to > use the pure CPython modules without needing to rely on any of the modified > versions built for IronPython. Below is the PowerShell output from starting > EPD and importing numpy and starting pythonnet python.exe and importing > numpy. > >>> > >>> PS G:\svn\Python\pythonnet\trunk\pythonnet\src\console\bin\Debug> > python #should load EPD python > >>> Enthought Python Distribution -- www.enthought.com > >>> Version: 7.3-2 (64-bit) > >>> > >>> Python 2.7.3 |EPD 7.3-2 (64-bit)| (default, Apr 12 2012, 15:20:16) > [MSC v.1500 64 bit (AMD64)] on win32 > >>> Type "credits", "demo" or "enthought" for more information. > >>> >>> import numpy; print numpy.__version__ > >>> 1.6.1 > >>> >>> exit() > >>> PS G:\svn\Python\pythonnet\trunk\pythonnet\src\console\bin\Debug> > .\python.exe > >>> Python 2.7.3 (default, Apr 10 2012, 23:24:47) [MSC v.1500 64 bit > (AMD64)] on win32 > >>> Type "help", "copyright", "credits" or "license" for more information. > >>> >>> import numpy > >>> [Bang!] - A window opens with > >>> TITLE: Microsoft Visual C++ Runtime Library > >>> Message: Runtime Error! > >>> > >>> Program: G:\svn\Python... > >>> > >>> R6034 > >>> An application has made an attempt to load the C runtime library > incorrectly > >>> Please contact the application's support team for more information > >>> """ > >>> > >>> This is not a lot of information, but maybe someone has some ideas on > how to troubleshoot? > >>> > >>> Thank you, > >>> john > >>> > >>> > >>> > >>> > >>> > >>> _________________________________________________ > >>> Python.NET mailing list - PythonDotNet at python.org > >>> http://mail.python.org/mailman/listinfo/pythondotnet > >> > >> > >> _________________________________________________ > >> Python.NET mailing list - PythonDotNet at python.org > >> http://mail.python.org/mailman/listinfo/pythondotnet > > > > -- > > Stephen P. Lepisto > > _________________________________________________ > > Python.NET mailing list - PythonDotNet at python.org > > http://mail.python.org/mailman/listinfo/pythondotnet > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://mail.python.org/pipermail/pythondotnet/attachments/20121103/e424dd20/attachment-0001.html > > > > ------------------------------ > > Subject: Digest Footer > > _______________________________________________ > PythonDotNet mailing list > PythonDotNet at python.org > http://mail.python.org/mailman/listinfo/pythondotnet > > > ------------------------------ > > End of PythonDotNet Digest, Vol 103, Issue 4 > ******************************************** > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfburkhart.reg at gmail.com Mon Nov 5 09:06:46 2012 From: jfburkhart.reg at gmail.com (John Burkhart) Date: Mon, 5 Nov 2012 09:06:46 +0100 Subject: [Python.NET] apologies for poor posting Message-ID: Just a quick apology for posting poorly. I am trying a new workflow to manage lists in gmail, and I didn't quite get it right just yet... -------------- next part -------------- An HTML attachment was scrubbed... URL: From adp at cypress.com Tue Nov 6 20:08:59 2012 From: adp at cypress.com (Anneka Boccio) Date: Tue, 6 Nov 2012 19:08:59 +0000 (UTC) Subject: [Python.NET] Getting started with Python for .NET Message-ID: I'm completely new to Python for .Net, and I actually have very little experience with Python and no experience with C#. So please forgive me if my question seems very basic. I'm using Python 2.7.3, and I downloaded pythonnet-2.0-alpha2-clr2.0_131_py27_UCS2 and unzipped it into a folder named pyfornet_test, which also contains the dll I'm trying to use (called DotNet4Class.dll) Then I run this: import sys import os import clr sys.path.append(r"C:\pyfornet_test") clr.AddReference("DotNet4Class.dll") Which gives me this error: System.IO.FileNotFoundException: Unable to find assembly 'DotNet4Class.dll'. at Python.Runtime.CLRModule.AddReference(String name) in C:\Users\Barton\Documents\Visual Studio 2008\Projects\PyShar p\trunk\pythonnet\src\runtime\moduleobject.cs:line 375 Any advice would be much appreciated. Thank you! From jfburkhart.reg at gmail.com Wed Nov 7 14:22:05 2012 From: jfburkhart.reg at gmail.com (John Burkhart) Date: Wed, 7 Nov 2012 14:22:05 +0100 Subject: [Python.NET] Getting started with Python for .NET Message-ID: Annika, I too just started with pythonnet. What I'm learning is that the compilation of pythonnet needs to match that of the .dll you are trying to load. So, for instance, how was your .dll built (for .NET 4? 3.5? ..). Check that. In my case I had to build pythonnet targeted for .NET 4 but it caused many other problems with underlying imports of pure CPython. I made a recent post on the issue for IPython: http://wiki.ipython.org/Cookbook/python.NET Maybe that will help! -------------- next part -------------- An HTML attachment was scrubbed... URL: From Liam.Corrigan at allenvanguard.com Wed Nov 7 14:42:18 2012 From: Liam.Corrigan at allenvanguard.com (Liam Corrigan) Date: Wed, 7 Nov 2012 13:42:18 +0000 Subject: [Python.NET] Getting started with Python for .NET In-Reply-To: References: Message-ID: <6E12B73DC225AD42A599ADB1B4EBD83003D2B839@SRVNA-EX02.allenvanguard.local> You do not need to add the extension in the AddReference call. Just clr.AddReference("DotNet4Class") From DotNet4Class import * ---------------------------------------------------------------------- Message: 1 Date: Tue, 6 Nov 2012 19:08:59 +0000 (UTC) From: Anneka Boccio To: pythondotnet at python.org Subject: [Python.NET] Getting started with Python for .NET Message-ID: Content-Type: text/plain; charset=us-ascii I'm completely new to Python for .Net, and I actually have very little experience with Python and no experience with C#. So please forgive me if my question seems very basic. I'm using Python 2.7.3, and I downloaded pythonnet-2.0-alpha2-clr2.0_131_py27_UCS2 and unzipped it into a folder named pyfornet_test, which also contains the dll I'm trying to use (called DotNet4Class.dll) Then I run this: import sys import os import clr sys.path.append(r"C:\pyfornet_test") clr.AddReference("DotNet4Class.dll") Which gives me this error: System.IO.FileNotFoundException: Unable to find assembly 'DotNet4Class.dll'. at Python.Runtime.CLRModule.AddReference(String name) in C:\Users\Barton\Documents\Visual Studio 2008\Projects\PyShar p\trunk\pythonnet\src\runtime\moduleobject.cs:line 375 Any advice would be much appreciated. Thank you! ------------------------------ Subject: Digest Footer _______________________________________________ PythonDotNet mailing list PythonDotNet at python.org http://mail.python.org/mailman/listinfo/pythondotnet ------------------------------ End of PythonDotNet Digest, Vol 103, Issue 7 ******************************************** This message is intended only for the use of the named addressee. It may contain information that is copywritten, privileged, confidential and exempt from disclosure under applicable law. If you are not the intended recipient, you are notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this in error, please notify the sender immediately and delete it from your system. Communications using this system are monitored and recorded for lawful business purposes. From jfburkhart.reg at gmail.com Fri Nov 9 12:51:55 2012 From: jfburkhart.reg at gmail.com (John Burkhart) Date: Fri, 9 Nov 2012 12:51:55 +0100 Subject: [Python.NET] strange behavior when adding Message-ID: Hello, I'm working with a custom built set of .NET 4 assemblies. The .NET assemblies have a type 'TimeSeries'. These time series can have operations conducted on them (addition, averaging, etc.), which returns a new type ('BinaryOperation'). I can do this in IronPython no problem: >>> >>> type(tsvalues) >>> type(tsvalues[0]) >>> sumts = tsvalues[0] + tsvalues[1] >>> type(sumts) >>> However, in pythonnet the BinaryOperation fails... conducting the identical steps in pythonnet I get the following: >>> type(tsvalues) System.Collections.Generic.0, Culture=neutral, PublicKeyToken=null]] >>> type(tsvalues[0]) TimeSeries >>> sumts = tsvalues[0]+tsvalues[1] --------------------------------------------------------------------------- TypeError Traceback (most recent call last) in () ----> 1 sumts = tsvalues[0]+tsvalues[1] TypeError: unsupported operand type(s) for +: 'TimeSeries' and 'TimeSeries' Any ideas on why pythonnet and IronPython would handle operations on my class types differently? In pythonnet do my types have to have the .__add__, .__sub__, etc. method-wrappers implemented?? Thank you, john -------------- next part -------------- An HTML attachment was scrubbed... URL: From antoniopiri87 at gmail.com Tue Nov 13 13:00:28 2012 From: antoniopiri87 at gmail.com (Antonio Palomo) Date: Tue, 13 Nov 2012 13:00:28 +0100 Subject: [Python.NET] Problem install PythonNet 2 in ubuntu10.04 with python 2.6 and mono 2.10 Message-ID: hi !! I want to use Python.NET, but i?m doing something wrong because when i import clr in python i get the next error *** glibc detected *** python: free(): invalid pointer: 0xb619c100 *** i have done the steps are as follows: + install mono 2.10 + install libmono-2.0.so.1 + download pythonnet-2.0-alpha2-136-py26.zip I have unzipped it and i have tried execute setup.py with python, but this give me this error : Perhaps you should add the directory containing `mono-2.pc' to the PKG_CONFIG_PATH environment variable) but i haven?t got this file. So i have copied the files in /pythonnet-2.0-alpha2-136-py26/python2.6-UCS2 to my folder where i have python packages /usr/local/lib/python2.7/dist-packages/ and after i have tried import clr in shell of python ,at this point I've gotten the bug I mentioned at the beginning . if anyone can help me telling me how to solve some of the problems would be very grateful :) thanks!!! Antonio -------------- next part -------------- An HTML attachment was scrubbed... URL: