I've been struggling with this for a few days, and can't seem to get a straight-forward way of achieving this. I don't have too much experience with .Net and Mono, but enough to be able to build an application.
The problem i'm having is that i want to write a c# application, and run python processes in the background. These python processes also have imports, and thus i need to be able to run them in their anaconda environment.
I've read and experimented with IronPython and PythonNet, but have had only limited success. As IronPython is in fact capable of running my python scripts, it can't find the imports. Pythonnet on the other hand has been a pain in the *** as i can't seem to be able to get it running, neither by installing from Nuget, nor Anaconda, nor building from source. I believe pythonNet would be best for achieving this, but have been unable to get it to work, since the setup always complains about my .Net version, or my mono application using Python.Runtime cannot find the right python installation.
I'm using an Anaconda2 (local installation) on an Ubuntu 18.04 64bit machine with monodevelop/visual studio code. Just to be clear, i have in fact looked for solutions on both stackexchange, as the pythonnet github pages.
I didnt work with *conda so much but I have two ideas:
write your python programs in a way that you just launch them with some arguments and wait for their results:
there is new ML.NET machine learning framework from Microsoft, so you can check it
edit: as Steve said, instead of stdout you can use also sockets, if you want to use it interactively