17

I'm developing a windows 10 universal app in VS15 using the new .NETCore reference assemblies and want to reference the IronPython library. Unfortunately, IronPython targets .NETFramework and not .NETCore. Does anybody know of an alternative library for running python scripts within .NET using C#, a way to make IronPython portable, or a way to work around the project targeting .NETCore? Other possible solutions welcomed. Also does anybody know whether IronPython will become .NETCore compatible/if that's possible? Thank you. PS I am trying to execute very simple python scripts and display the interpreter's output.

Alfred Young
  • 397
  • 1
  • 3
  • 15
  • I'm interested too! For the moment i'm using DynamicLINQ and runtime compiled lambdas. – Mauro Destro Aug 25 '15 at 09:15
  • @lexLi c# is not really dynamic now, it is jsut better compile and executable as script/ at runtime. – BendEg Dec 17 '15 at 21:32
  • Considering that the last release / blog post is from late 2014 (before the .NET Core announcement even) I would consider this project as dead. So in my perspective there will be no port and it would not be a good decision to integrate this library into a production scenario. – Thomas Jun 27 '16 at 16:47
  • The DotNet Core team should really focus on Bringing Iron Python to DotNet core. Much functionality is still missing in DotNet Core (Like image manipulation). Cloud services like Azure, AWS, etc support running .Net, Pyhon, and PHP on the same Application. If we had Iron Python we could do Image stuff in OpenCV on Python and everything else on DotNet Core. It would be good to get us by while more things are made for DotNet Core. – Ryan Mann Jul 31 '16 at 05:27
  • 2
    @AlfredYoung Do you need to interact with the python script much or just send some arguments? If you just need to run it and get the result, I think the System.Diagnostics.Process and ProcessStartInfo classes that are included in the .Net core will allow you to run python scripts command line style. – Evan P Dec 13 '16 at 21:10

1 Answers1

10

The IronPython-Team just released the beta of IronPython 2.7.8 supporting mono and .net core:

more infos here: https://github.com/IronLanguages/ironpython2/releases

There is also a nuget package IronPython. You probably need to switch from Stable only to Include Prerelease

IronPython 3 with support for mono and .net core is still in progress.

Update: with IronPython 2.7.10, the IronPython-Team added support for .NET Core 3.1.

Matthias Burger
  • 5,549
  • 7
  • 49
  • 94
  • 1
    2 year update, Iron Python 3 is still "in progress". The repo is marked with a giant DO NOT USE banner. – Chris Marisic Oct 29 '19 at 16:30
  • @ChrisMarisic thats correct. for me, the v2.7 does its job. – Matthias Burger Oct 29 '19 at 17:30
  • It really bites that IronPython 2.7 does not support writing dotnetcore DLLs (`clr.Compile`) or Python 3.x yet. Specifically I can't find any way to generate a pygments.dll that is compatible with dotnet core. Would love any ideas... – tig Apr 26 '20 at 23:56
  • 2.7.10 is released! This release adds .NET Core 3.1 support. https://github.com/IronLanguages/ironpython2/releases/tag/ipy-2.7.10 – Pavel Biryukov Jun 22 '20 at 15:27