From david at lechnology.com Mon Jun 3 06:38:38 2013 From: david at lechnology.com (David Lechner) Date: Sun, 02 Jun 2013 23:38:38 -0500 Subject: [Python.NET] Python 3 version of Python for .NET In-Reply-To: References: Message-ID: On 2/28/2013 9:23 AM, Tony Roberts wrote: > If someone can let me know how to contribute these changes back to the > main project I'm happy to do that. The changes are backwards compatible > so everything still works the same with older versions of python. If this never made it back to the main project, could I at least get a copy of the source code? I have just stumbled across this and it is exactly what I need. Of course, I have already managed to crash it because I am using Python 3 and I have discovered that PyNumber_Int has been removed from the Python C API and I would like to fix it. From tony at pyxll.com Mon Jun 3 08:26:34 2013 From: tony at pyxll.com (Tony Roberts) Date: Mon, 3 Jun 2013 07:26:34 +0100 Subject: [Python.NET] Python 3 version of Python for .NET In-Reply-To: References: Message-ID: Hi David, sure, you can get the code from here: https://github.com/tonyroberts/pythonnet and I put some pre-built binaries here: http://www.pyxll.com/pythonnet/ Tony On Mon, Jun 3, 2013 at 5:38 AM, David Lechner wrote: > On 2/28/2013 9:23 AM, Tony Roberts wrote: > >> If someone can let me know how to contribute these changes back to the >> main project I'm happy to do that. The changes are backwards compatible >> so everything still works the same with older versions of python. >> > > If this never made it back to the main project, could I at least get a > copy of the source code? I have just stumbled across this and it is exactly > what I need. Of course, I have already managed to crash it because I am > using Python 3 and I have discovered that PyNumber_Int has been removed > from the Python C API and I would like to fix it. > > > ______________________________**___________________ > Python.NET mailing list - PythonDotNet at python.org > http://mail.python.org/**mailman/listinfo/pythondotnet > -------------- next part -------------- An HTML attachment was scrubbed... URL: From david at lechnology.com Mon Jun 3 22:47:21 2013 From: david at lechnology.com (David Lechner) Date: Mon, 03 Jun 2013 15:47:21 -0500 Subject: [Python.NET] Python 3 version of Python for .NET In-Reply-To: References: Message-ID: On 6/3/2013 1:26 AM, Tony Roberts wrote: > Hi David, > > sure, you can get the code from here: > https://github.com/tonyroberts/pythonnet > and I put some pre-built binaries here: http://www.pyxll.com/pythonnet/ > > Tony Awesome! Thanks very much! From alondu at gmail.com Wed Jun 12 16:35:02 2013 From: alondu at gmail.com (Alon Dulce) Date: Wed, 12 Jun 2013 17:35:02 +0300 Subject: [Python.NET] running pythonnet on MAC OSX[new to MAC and not not a programmer] Message-ID: Hi, I want to run python.NET on MAC OSX (Mountain Lion) and since I'm new to MAC/UNIX and I'm not a programmer I naturally turned to the web: *1st : I tried iron python using eclipse with MONO (configuring eclipse iron python interpreter to the mono framework "/Library/Frameworks/Mono.framework/Versions/icy" file) - eclipse doesn't allow this and I got the following error: "No output was in the standard output when trying to create the interpreter info." *2nd : I tried python.NET on XAMARIN : I found this link: http://curtis.schlak.com/2012/01/17/howto-run-pythonnet-on-osx.html I followed all the instructions but it's not clear to me how can I write python in XAMARIN, import clr etc. (I set up the solution as explained in the link above but I'm not sure about the next step). * 3rd try : I found a post on this mailing list : http://mail.python.org/pipermail/pythondotnet/2011-September/001171.html I tried using the original makefile and setup.py (both makefiles) with "sudo setup.py install" and received the following error: "dyld: DYLD_ environment variables being ignored because main executable (/usr/bin/sudo) is setuid or setgid /bin/sh: pkg-config: command not found Traceback (most recent call last): File "setup.py", line 46, in argsDict = pkgconfig('glib-2.0', 'mono-2') File "setup.py", line 32, in pkgconfig raise RuntimeError("An error has occured") RuntimeError: An error has occured " I also tried editing the makefiles and setup.py according to the diff file supplied in the thread but still no success. Is there a makefile/ setup.py file that will work on MAC ? maybe some sort of step by step monkey guide... :-) I appreciate the help, Alon. -------------- next part -------------- An HTML attachment was scrubbed... URL: From brad at fie.us Fri Jun 14 00:53:35 2013 From: brad at fie.us (brad at fie.us) Date: Thu, 13 Jun 2013 18:53:35 -0400 Subject: [Python.NET] running pythonnet on MAC OSX[new to MAC and not not a programmer] In-Reply-To: References: Message-ID: <9F604257-A96A-4D5B-9713-E5F29CD45A63@fie.us> Ahh. Yes. I do it differently these days. Will get back to you shortly. -brad On Jun 12, 2013, at 10:35 AM, Alon Dulce wrote: > Hi, > > I want to run python.NET on MAC OSX (Mountain Lion) and since I'm new to MAC/UNIX and I'm not a programmer I naturally turned to the web: > > *1st : I tried iron python using eclipse with MONO (configuring eclipse iron python interpreter to the mono framework "/Library/Frameworks/Mono.framework/Versions/icy" file) - eclipse doesn't allow this and I got the following error: > > "No output was in the standard output when trying to create the interpreter info." > > *2nd : I tried python.NET on XAMARIN : > > I found this link: http://curtis.schlak.com/2012/01/17/howto-run-pythonnet-on-osx.html > > I followed all the instructions but it's not clear to me how can I write python in XAMARIN, import clr etc. (I set up the solution as explained in the link above but I'm not sure about the next step). > > * 3rd try : > I found a post on this mailing list : > http://mail.python.org/pipermail/pythondotnet/2011-September/001171.html > > I tried using the original makefile and setup.py (both makefiles) with "sudo setup.py install" and received the following error: > "dyld: DYLD_ environment variables being ignored because main executable (/usr/bin/sudo) is setuid or setgid > /bin/sh: pkg-config: command not found > Traceback (most recent call last): > File "setup.py", line 46, in > argsDict = pkgconfig('glib-2.0', 'mono-2') > File "setup.py", line 32, in pkgconfig > raise RuntimeError("An error has occured") > RuntimeError: An error has occured > " > > I also tried editing the makefiles and setup.py according to the diff file supplied in the thread but still no success. > > Is there a makefile/ setup.py file that will work on MAC ? maybe some sort of step by step monkey guide... :-) > > I appreciate the help, > Alon. > _________________________________________________ > Python.NET mailing list - PythonDotNet at python.org > http://mail.python.org/mailman/listinfo/pythondotnet -------------- next part -------------- An HTML attachment was scrubbed... URL: From brad at fie.us Fri Jun 14 01:01:07 2013 From: brad at fie.us (brad at fie.us) Date: Thu, 13 Jun 2013 19:01:07 -0400 Subject: [Python.NET] running pythonnet on MAC OSX[new to MAC and not not a programmer] In-Reply-To: References: Message-ID: So, firstly, I build my own 64bit mono. In that last thread, I said I was doing it off of their tar ball. I updated that slightly. I now maintain my own local "mac ports" port file. Attached is the latest one I built. It may need updating. And at the very least, you probably want to update it to build into a different place than my company's directory on my systems. Once it's built, it does create it's own pkg-config directory so you can use it in building python-net You can try and build against the usual 32-bit mono distributions on OSX. But it's usually a bad idea. Python is usually 64-bit in most places you'd want to use it in OSX. When Xamarin finally gets around to fully distributing in 64-bit on OSX by default, things will be easier and this part won't be necessary. On Jun 12, 2013, at 10:35 AM, Alon Dulce wrote: > Hi, > > I want to run python.NET on MAC OSX (Mountain Lion) and since I'm new to MAC/UNIX and I'm not a programmer I naturally turned to the web: > > *1st : I tried iron python using eclipse with MONO (configuring eclipse iron python interpreter to the mono framework "/Library/Frameworks/Mono.framework/Versions/icy" file) - eclipse doesn't allow this and I got the following error: > > "No output was in the standard output when trying to create the interpreter info." > > *2nd : I tried python.NET on XAMARIN : > > I found this link: http://curtis.schlak.com/2012/01/17/howto-run-pythonnet-on-osx.html > > I followed all the instructions but it's not clear to me how can I write python in XAMARIN, import clr etc. (I set up the solution as explained in the link above but I'm not sure about the next step). > > * 3rd try : > I found a post on this mailing list : > http://mail.python.org/pipermail/pythondotnet/2011-September/001171.html > > I tried using the original makefile and setup.py (both makefiles) with "sudo setup.py install" and received the following error: > "dyld: DYLD_ environment variables being ignored because main executable (/usr/bin/sudo) is setuid or setgid > /bin/sh: pkg-config: command not found > Traceback (most recent call last): > File "setup.py", line 46, in > argsDict = pkgconfig('glib-2.0', 'mono-2') > File "setup.py", line 32, in pkgconfig > raise RuntimeError("An error has occured") > RuntimeError: An error has occured > " > > I also tried editing the makefiles and setup.py according to the diff file supplied in the thread but still no success. > > Is there a makefile/ setup.py file that will work on MAC ? maybe some sort of step by step monkey guide... :-) > > I appreciate the help, > Alon. > _________________________________________________ > Python.NET mailing list - PythonDotNet at python.org > http://mail.python.org/mailman/listinfo/pythondotnet -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Portfile Type: application/octet-stream Size: 3645 bytes Desc: not available URL: -------------- next part -------------- An HTML attachment was scrubbed... URL: From brad at fie.us Fri Jun 14 01:45:39 2013 From: brad at fie.us (brad at fie.us) Date: Thu, 13 Jun 2013 19:45:39 -0400 Subject: [Python.NET] running pythonnet on MAC OSX[new to MAC and not not a programmer] In-Reply-To: References: Message-ID: <8A9FBE19-6BBE-4738-9D9E-777D9B353BF5@fie.us> Second, here is the latest, ugly ugly diff from my working version. I would not just blindly apply this. It needs to be taken apart. I did a lot of bad things in it. It needs to be revisited. But it does work and did provide me functioning pythonnet binaries and config files that work correctly. It imports into the system python2.7 as well as into Maya's embedded Python and Nuke's embedded Python. All on OSX. Some highlights? There were earlier commits of changes made by a user, "VIKAS DHIMAN" And those changes seemed to hard-code the system to ubuntu/debian locations and names. And a lot of what I had to do was revert those changes. However, I have been heavy handed in this diff in some places. Which is why I wouldn't want it committed back without re-working it. It should be neutral, rather than for one platform or the other. I added dllmap entries into the .config file for OSX. I also added an "__internal" which is what mono will need for embedded python. This allows it to run in maya and nuke on OSX in many cases. VIkas' setup.py file assumed the location of the pkg-config directory. I removed that assumption. So you need to set the PKG_CONFIG_PATH yourself before building. That is what allows you to pick which mono it builds against. Which is kind of important. And that's what a configure script is for. but since there isn't one, you do it yourself. On a proper linux package managed system, it's already set. There should be no need to hard-code it in the default case. I changed the monoclr makefile to accept the existing python executable rather than override it. I changed it to use gcc to compile rather than g++. I recall that being an Xcode thing. I updated it to use the more modern names of pkg-config packages for mono and glib. I made sure it used the glib flags too. iirc, glib's pkg-config is in the mac-ports dist location per my port file. so in my case, that's /opt/local/lib/pkgconfig/ . I have a bug fix in there that deals with "Reflection Only" assemblies being scanned for types when they should not be. I removed a clirmodule.il file that needs to not be there, in order for some of the build logic to function. I added some code to make it skip scanning of generics that have no namespace. this is a hack and probably needs further review. And there's ton of cruft in there where monodevelop was updating .csproj files and such. On Jun 12, 2013, at 10:35 AM, Alon Dulce wrote: > Hi, > > I want to run python.NET on MAC OSX (Mountain Lion) and since I'm new to MAC/UNIX and I'm not a programmer I naturally turned to the web: > > *1st : I tried iron python using eclipse with MONO (configuring eclipse iron python interpreter to the mono framework "/Library/Frameworks/Mono.framework/Versions/icy" file) - eclipse doesn't allow this and I got the following error: > > "No output was in the standard output when trying to create the interpreter info." > > *2nd : I tried python.NET on XAMARIN : > > I found this link: http://curtis.schlak.com/2012/01/17/howto-run-pythonnet-on-osx.html > > I followed all the instructions but it's not clear to me how can I write python in XAMARIN, import clr etc. (I set up the solution as explained in the link above but I'm not sure about the next step). > > * 3rd try : > I found a post on this mailing list : > http://mail.python.org/pipermail/pythondotnet/2011-September/001171.html > > I tried using the original makefile and setup.py (both makefiles) with "sudo setup.py install" and received the following error: > "dyld: DYLD_ environment variables being ignored because main executable (/usr/bin/sudo) is setuid or setgid > /bin/sh: pkg-config: command not found > Traceback (most recent call last): > File "setup.py", line 46, in > argsDict = pkgconfig('glib-2.0', 'mono-2') > File "setup.py", line 32, in pkgconfig > raise RuntimeError("An error has occured") > RuntimeError: An error has occured > " > > I also tried editing the makefiles and setup.py according to the diff file supplied in the thread but still no success. > > Is there a makefile/ setup.py file that will work on MAC ? maybe some sort of step by step monkey guide... :-) > > I appreciate the help, > Alon. > _________________________________________________ > Python.NET mailing list - PythonDotNet at python.org > http://mail.python.org/mailman/listinfo/pythondotnet -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: pythonnet.machack.ugly.diff Type: application/octet-stream Size: 37916 bytes Desc: not available URL: -------------- next part -------------- An HTML attachment was scrubbed... URL: From ingo_kaufmann at gmx.de Fri Jun 14 18:06:03 2013 From: ingo_kaufmann at gmx.de (Ingo Kaufmann) Date: Fri, 14 Jun 2013 18:06:03 +0200 (CEST) Subject: [Python.NET] Problem using a dll: Function call fails with TypeError: No method matches given arguments Message-ID: An HTML attachment was scrubbed... URL: From alondu at gmail.com Sat Jun 15 16:56:01 2013 From: alondu at gmail.com (Alon Dulce) Date: Sat, 15 Jun 2013 17:56:01 +0300 Subject: [Python.NET] running pythonnet on MAC OSX[new to MAC and not not a programmer] In-Reply-To: <8A9FBE19-6BBE-4738-9D9E-777D9B353BF5@fie.us> References: <8A9FBE19-6BBE-4738-9D9E-777D9B353BF5@fie.us> Message-ID: Hi Brad, Thank you very much for the detailed explanation, I will try this and report about my progress :-) Alon. On Fri, Jun 14, 2013 at 2:45 AM, brad at fie.us wrote: > Second, here is the latest, ugly ugly diff from my working version. > > I would not just blindly apply this. It needs to be taken apart. I did > a lot of bad things in it. It needs to be revisited. But it does work and > did provide me functioning pythonnet binaries and config files that work > correctly. It imports into the system python2.7 as well as into Maya's > embedded Python and Nuke's embedded Python. All on OSX. > > Some highlights? > > There were earlier commits of changes made by a user, "VIKAS DHIMAN" And > those changes seemed to hard-code the system to ubuntu/debian locations and > names. And a lot of what I had to do was revert those changes. However, I > have been heavy handed in this diff in some places. Which is why I > wouldn't want it committed back without re-working it. It should be > neutral, rather than for one platform or the other. > > I added dllmap entries into the .config file for OSX. I also added an > "__internal" which is what mono will need for embedded python. This allows > it to run in maya and nuke on OSX in many cases. > > VIkas' setup.py file assumed the location of the pkg-config directory. I > removed that assumption. So you need to set the PKG_CONFIG_PATH yourself > before building. That is what allows you to pick which mono it builds > against. Which is kind of important. And that's what a configure script > is for. but since there isn't one, you do it yourself. On a proper linux > package managed system, it's already set. There should be no need to > hard-code it in the default case. > > I changed the monoclr makefile to accept the existing python executable > rather than override it. > > I changed it to use gcc to compile rather than g++. I recall that being > an Xcode thing. > > I updated it to use the more modern names of pkg-config packages for mono > and glib. I made sure it used the glib flags too. iirc, glib's > pkg-config is in the mac-ports dist location per my port file. so in my > case, that's /opt/local/lib/pkgconfig/ . > > I have a bug fix in there that deals with "Reflection Only" assemblies > being scanned for types when they should not be. > > I removed a clirmodule.il file that needs to not be there, in order for > some of the build logic to function. > > I added some code to make it skip scanning of generics that have no > namespace. this is a hack and probably needs further review. > > And there's ton of cruft in there where monodevelop was updating .csproj > files and such. > > > > > On Jun 12, 2013, at 10:35 AM, Alon Dulce wrote: > > Hi, > > I want to run python.NET on MAC OSX (Mountain Lion) and since I'm new to > MAC/UNIX and I'm not a programmer I naturally turned to the web: > > *1st : I tried iron python using eclipse with MONO (configuring eclipse > iron python interpreter to the mono framework > "/Library/Frameworks/Mono.framework/Versions/icy" file) - eclipse doesn't > allow this and I got the following error: > > "No output was in the standard output when trying to create the > interpreter info." > > *2nd : I tried python.NET on XAMARIN : > > I found this link: > http://curtis.schlak.com/2012/01/17/howto-run-pythonnet-on-osx.html > > I followed all the instructions but it's not clear to me how can I write > python in XAMARIN, import clr etc. (I set up the solution as explained in > the link above but I'm not sure about the next step). > > * 3rd try : > I found a post on this mailing list : > http://mail.python.org/pipermail/pythondotnet/2011-September/001171.html > > I tried using the original makefile and setup.py (both makefiles) with > "sudo setup.py install" and received the following error: > "dyld: DYLD_ environment variables being ignored because main executable > (/usr/bin/sudo) is setuid or setgid > /bin/sh: pkg-config: command not found > Traceback (most recent call last): > File "setup.py", line 46, in > argsDict = pkgconfig('glib-2.0', 'mono-2') > File "setup.py", line 32, in pkgconfig > raise RuntimeError("An error has occured") > RuntimeError: An error has occured > " > > I also tried editing the makefiles and setup.py according to the diff file > supplied in the thread but still no success. > > Is there a makefile/ setup.py file that will work on MAC ? maybe some sort > of step by step monkey guide... :-) > > I appreciate the help, > Alon. > _________________________________________________ > Python.NET mailing list - PythonDotNet at python.org > http://mail.python.org/mailman/listinfo/pythondotnet > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From brad at fie.us Thu Jun 20 20:38:34 2013 From: brad at fie.us (Bradley Friedman) Date: Thu, 20 Jun 2013 14:38:34 -0400 Subject: [Python.NET] running pythonnet on MAC OSX[new to MAC and not not a programmer] In-Reply-To: References: Message-ID: <885B9E1F-6EAA-4FE1-91F4-0A13E8DDDF49@fie.us> On my system, the file is in: ~/ports/devel/fie-mono-64 but again, I'd suggest modifying it to better suit your needs. The commented content of the portfile is intentionally commented. The intention was to get the portfile building and deploying 64 bit mono in as simple and supported a way as possible. A lot of the way macports had been building mono seemed to be older cruft from less mac friendly versions of mono. I half expected to have to put them back in. So I left them commented. But so far, no issues have popped up. -brad On Jun 20, 2013, at 11:53 AM, Alon Dulce wrote: > Hi, > > I tried using the portfile attached without success, are all the commented lines supposed to be commented ? > I did the following steps: > > 1. I setup a folder for my local macports "~/Documents/Loc_Macports/" > 2. Inside this folder I set up the directory structure according to what I understood from the port file attached: > "~/Documents/Loc_Macports/devel/lang/mono/" and put the portfile in that folder > 3.I didn't see any patch files in the port file (all are commented) - so I didn't do anything regarding this. > 4. I edited the source.conf file with : > open -a TextEdit /opt/local/etc/ports/sources.conf > and added before the following line: > file:///Users//~/Loc_Macports/ > > before this line : > > rsync://rsync.macports.org/release/tarballs/ports.tar [default] > > 5. I indexed my local repository: > portindex ~/Documents/Loc_Macports/ > > But i received notification that none were indexed and here I'm stuck. > > Any insights ? > > BR, > Alon. > > > > ---------- Forwarded message ---------- > From: brad at fie.us > Date: Fri, Jun 14, 2013 at 2:01 AM > Subject: Re: [Python.NET] running pythonnet on MAC OSX[new to MAC and not not a programmer] > To: Alon Dulce > Cc: pythondotnet at python.org > > > So, firstly, I build my own 64bit mono. In that last thread, I said I was doing it off of their tar ball. > > I updated that slightly. I now maintain my own local "mac ports" port file. > > Attached is the latest one I built. It may need updating. And at the very least, you probably want to update it to build into a different place than my company's directory on my systems. > > Once it's built, it does create it's own pkg-config directory so you can use it in building python-net > > You can try and build against the usual 32-bit mono distributions on OSX. But it's usually a bad idea. Python is usually 64-bit in most places you'd want to use it in OSX. When Xamarin finally gets around to fully distributing in 64-bit on OSX by default, things will be easier and this part won't be necessary. > > > > > > On Jun 12, 2013, at 10:35 AM, Alon Dulce wrote: > >> Hi, >> >> I want to run python.NET on MAC OSX (Mountain Lion) and since I'm new to MAC/UNIX and I'm not a programmer I naturally turned to the web: >> >> *1st : I tried iron python using eclipse with MONO (configuring eclipse iron python interpreter to the mono framework "/Library/Frameworks/Mono.framework/Versions/icy" file) - eclipse doesn't allow this and I got the following error: >> >> "No output was in the standard output when trying to create the interpreter info." >> >> *2nd : I tried python.NET on XAMARIN : >> >> I found this link: http://curtis.schlak.com/2012/01/17/howto-run-pythonnet-on-osx.html >> >> I followed all the instructions but it's not clear to me how can I write python in XAMARIN, import clr etc. (I set up the solution as explained in the link above but I'm not sure about the next step). >> >> * 3rd try : >> I found a post on this mailing list : >> http://mail.python.org/pipermail/pythondotnet/2011-September/001171.html >> >> I tried using the original makefile and setup.py (both makefiles) with "sudo setup.py install" and received the following error: >> "dyld: DYLD_ environment variables being ignored because main executable (/usr/bin/sudo) is setuid or setgid >> /bin/sh: pkg-config: command not found >> Traceback (most recent call last): >> File "setup.py", line 46, in >> argsDict = pkgconfig('glib-2.0', 'mono-2') >> File "setup.py", line 32, in pkgconfig >> raise RuntimeError("An error has occured") >> RuntimeError: An error has occured >> " >> >> I also tried editing the makefiles and setup.py according to the diff file supplied in the thread but still no success. >> >> Is there a makefile/ setup.py file that will work on MAC ? maybe some sort of step by step monkey guide... :-) >> >> I appreciate the help, >> Alon. >> _________________________________________________ >> Python.NET mailing list - PythonDotNet at python.org >> http://mail.python.org/mailman/listinfo/pythondotnet > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From alondu at gmail.com Thu Jun 20 17:53:22 2013 From: alondu at gmail.com (Alon Dulce) Date: Thu, 20 Jun 2013 18:53:22 +0300 Subject: [Python.NET] Fwd: running pythonnet on MAC OSX[new to MAC and not not a programmer] In-Reply-To: References: Message-ID: Hi, I tried using the portfile attached without success, are all the commented lines supposed to be commented ? I did the following steps: 1. I setup a folder for my local macports "~/Documents/Loc_Macports/" 2. Inside this folder I set up the directory structure according to what I understood from the port file attached: "~/Documents/Loc_Macports/devel/lang/mono/" and put the portfile in that folder 3.I didn't see any patch files in the port file (all are commented) - so I didn't do anything regarding this. 4. I edited the source.conf file with : open -a TextEdit /opt/local/etc/ports/sources.conf and added before the following line: file:///Users//~/Loc_Macports/ before this line : rsync://rsync.macports.org/release/tarballs/ports.tar [default] 5. I indexed my local repository: portindex ~/Documents/Loc_Macports/ But i received notification that none were indexed and here I'm stuck. Any insights ? BR, Alon. ---------- Forwarded message ---------- From: brad at fie.us Date: Fri, Jun 14, 2013 at 2:01 AM Subject: Re: [Python.NET] running pythonnet on MAC OSX[new to MAC and not not a programmer] To: Alon Dulce Cc: pythondotnet at python.org So, firstly, I build my own 64bit mono. In that last thread, I said I was doing it off of their tar ball. I updated that slightly. I now maintain my own local "mac ports" port file. Attached is the latest one I built. It may need updating. And at the very least, you probably want to update it to build into a different place than my company's directory on my systems. Once it's built, it does create it's own pkg-config directory so you can use it in building python-net You can try and build against the usual 32-bit mono distributions on OSX. But it's usually a bad idea. Python is usually 64-bit in most places you'd want to use it in OSX. When Xamarin finally gets around to fully distributing in 64-bit on OSX by default, things will be easier and this part won't be necessary. On Jun 12, 2013, at 10:35 AM, Alon Dulce wrote: Hi, I want to run python.NET on MAC OSX (Mountain Lion) and since I'm new to MAC/UNIX and I'm not a programmer I naturally turned to the web: *1st : I tried iron python using eclipse with MONO (configuring eclipse iron python interpreter to the mono framework "/Library/Frameworks/Mono.framework/Versions/icy" file) - eclipse doesn't allow this and I got the following error: "No output was in the standard output when trying to create the interpreter info." *2nd : I tried python.NET on XAMARIN : I found this link: http://curtis.schlak.com/2012/01/17/howto-run-pythonnet-on-osx.html I followed all the instructions but it's not clear to me how can I write python in XAMARIN, import clr etc. (I set up the solution as explained in the link above but I'm not sure about the next step). * 3rd try : I found a post on this mailing list : http://mail.python.org/pipermail/pythondotnet/2011-September/001171.html I tried using the original makefile and setup.py (both makefiles) with "sudo setup.py install" and received the following error: "dyld: DYLD_ environment variables being ignored because main executable (/usr/bin/sudo) is setuid or setgid /bin/sh: pkg-config: command not found Traceback (most recent call last): File "setup.py", line 46, in argsDict = pkgconfig('glib-2.0', 'mono-2') File "setup.py", line 32, in pkgconfig raise RuntimeError("An error has occured") RuntimeError: An error has occured " I also tried editing the makefiles and setup.py according to the diff file supplied in the thread but still no success. Is there a makefile/ setup.py file that will work on MAC ? maybe some sort of step by step monkey guide... :-) I appreciate the help, Alon. _________________________________________________ Python.NET mailing list - PythonDotNet at python.org http://mail.python.org/mailman/listinfo/pythondotnet -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Portfile Type: application/octet-stream Size: 3747 bytes Desc: not available URL: From avi.m at racana.com Mon Jun 24 15:19:18 2013 From: avi.m at racana.com (Avi Mitrani) Date: Mon, 24 Jun 2013 16:19:18 +0300 Subject: [Python.NET] Calling Python functions/objects forom C# code Message-ID: <000301ce70dd$746f5620$5d4e0260$@racana.com> Dear mailing list members, I'm new to PythonDotNet, and to integrating Python & C#, and I have to say that I'm 'breaking my teeth' with it; can't find the right examples on the web. The context: I want to use the rich machine learning resources found in python (like scikit-learn) inside a big project written in c#. The problem: can't get started! - haven't even managed to call a function yet. Is there an example or tutorial you can direct me to? Let's say that I want to call the function fib2 from the first example module in python.org, called (fibo.py): ------------------------------------------------------- # Fibonacci numbers module def fib(n): # write Fibonacci series up to n a, b = 0, 1 while b < n: print b, a, b = b, a+b def fib2(n): # return Fibonacci series up to n result = [] a, b = 0, 1 while b < n: result.append(b) a, b = b, a+b return result ------------------------------------------------------- These lines compile J : PythonEngine.Initialize(); PyObject fibmodule = PythonEngine.ImportModule("fibo"); PyObject fibfunc = fibmodule.GetAttr("fib2"); Where do I go from here? How do I send input and get the output into c# array/list? I guess I would need to use PyInt & PyList. How do I do that? Thanks in advance, Avi -------------- next part -------------- An HTML attachment was scrubbed... URL: