From Brittany.Griffin at ngc.com Wed Aug 8 17:41:58 2012 From: Brittany.Griffin at ngc.com (Griffin, Brittany (AS)) Date: Wed, 8 Aug 2012 15:41:58 +0000 Subject: [Python.NET] using Python.NET with .NET4/VS2010 in Python 2.7 Message-ID: <6223010894E66C4A988D53830D23E9B4023A9ABE@XMBIL194.northgrum.com> Hi, I'm trying to set up my pythonnet download to work with the .NET 4 framework. I'm new to this, so I might just be overlooking something. I've found many forums (currently using this one: http://blog.bidiuk.com/2011/01/python-net-and-vs2010-net-4/ ) explaining the process to do this and have been successful in changing the cprojects to target .NET4, by using VS2010 express. But, I cannot find the buildclrmodule.bat file in my current download in order to change it to reference .NET4 as well. Therefore, I currently get this error when trying to load a .NET4 assembly: SystemError: dynamic module not initialized properly. I've gone back and looked through other downloads and have not come across the file. Can anyone direct me to where I could get this file they are referencing, or how to fix this disconnection? Also, I am using Python 2.7. My current Pythonnet download (pythonnet-2.0-alpha2.zip) seems to only be programmed up to 2.6. Any time I build the Runtime Assembly, it outputs a Python 2.5 Runtime.dll. Any direction with this would be very helpful! Thanks for your help!! -------------- next part -------------- An HTML attachment was scrubbed... URL: From dave.hirschfeld at gmail.com Wed Aug 8 18:01:04 2012 From: dave.hirschfeld at gmail.com (Dave Hirschfeld) Date: Wed, 8 Aug 2012 16:01:04 +0000 (UTC) Subject: [Python.NET] using Python.NET with .NET4/VS2010 in Python 2.7 References: <6223010894E66C4A988D53830D23E9B4023A9ABE@XMBIL194.northgrum.com> Message-ID: Griffin, Brittany (AS writes: > > > > Hi, > I?m trying to set up my pythonnet download to work with the .NET 4 framework.? I?m new to this, so I might just be overlooking something.? > > I?ve found many forums (currently using this one: > http://blog.bidiuk.com/2011/01/python-net-and-vs2010-net-4/ ) explaining the process to do this and have been successful in changing the cprojects to target .NET4, by using VS2010 express.? But, I cannot find the ?buildclrmodule.bat file in my current > download in order to change it to reference .NET4 as well. Therefore, I currently get this error when trying to load a .NET4 assembly:? > SystemError: dynamic module not initialized properly. I?ve gone back and looked through other downloads and have not come across the file.? Can anyone direct me to where I could get this file they are referencing, or how to fix this disconnection?? > ? > Also, I am using Python 2.7. ?My current Pythonnet download (pythonnet-2.0- alpha2.zip) seems to only be programmed up to 2.6.? Any time I build the Runtime Assembly, it outputs a Python 2.5 Runtime.dll.? Any direction with this would be > very helpful!? > ? > Thanks for your help!! > ? Where are you getting your pythondotnet from? I'd recommend checking out the latest source from subversion - you can see the file is there: http://pythonnet.svn.sourceforge.net/viewvc/pythonnet/trunk/pythonnet/src/runtim e/ If that's missing it sounds like you might not have an up to date version in which case I'd be careful of just cherry picking that file. If you've got a subversion client installed you should be able to get the latest source by entering at the command line: svn co https://pythonnet.svn.sourceforge.net/svnroot/pythonnet pythonnet If not http://www.sliksvn.com/en/download/ is a command line svn client, or you can use tortoise - http://tortoisesvn.net/ In Visual Studio if you right-click the Python.Runtime project, choose properties then select the Build tab in the resulting dialog you'll see under "Conditional compilation symbols" PYTHON25,UCS2 or similar. To target Python 2.7 simply change that to PYTHON27,UCS2 HTH, Dave From tstanleyjones at gmail.com Tue Aug 14 23:39:41 2012 From: tstanleyjones at gmail.com (Thomas Stanley-Jones) Date: Tue, 14 Aug 2012 16:39:41 -0500 Subject: [Python.NET] PythonNet with ArcMap Message-ID: Hello, I'm looking for some help with how to get PythonNet working with ArcGIS 10.0. I've been trying to get this to work for the past few days as it will be very useful in accessing various objects of the program through Python. I'm pretty new to these processes, but after a lot of mucking around figured out how to get PythonNet to work on my 64bit machine with a 32bit installation of Python 2.6, building it with VS2010 Express. I could import clr with the normal Python console, and I could do the same with PyScripter 2.6, but I couldn't get it to work with the Python console provided with ArcMap, "dynamic module not initialized properly". Somebody thought it was because of a manifest with the module but I think I've confirmed that isn't it. It seems that it comes down to an issue with the version of Visual Studio I'm using to build the PythonNet solution, but after using VS2008 Express, importing clr only works in the normal Python console and not in PyScripter anymore (or in ArcMap). I don't have a very good understanding of what I'm doing to this or that, but if any of you could give me an idea of what to look for next, I would very much appreciate it. By the way, to get the build to work with my machine I'm forcing the project to build using x86 rather than ANY CPU or x64. Thanks, Tom -------------- next part -------------- An HTML attachment was scrubbed... URL: