Re: IronPython with Anaconda 3.7

Alex Earl

You can't mix and match python versions. You would need a 2.7 version of Anaconda because 2.7 is the version of python that ItonPython currently implements.

On Sat, Dec 28, 2019, 17:38 Ajay Kumar Wahi <AjayKumar.Wahi@...> wrote:

Hello everyone,


For past few days I am trying to integrate python script into C# application using IronPython. I have Anaconda 3.7.4 installed on the machine. I have added IronPython 2.7.9 as a reference to the project.

The targeted .Net framework is 4.7.2.


I am getting exception message while executing python script.



Below is the C# function that is setting up python environment and executing script:



ScriptEngine pythonEngine = IronPython.Hosting.Python.CreateEngine();


            ICollection<string> searchPaths = pythonEngine.GetSearchPaths();

            //string pythonInstallPath = Environment.GetEnvironmentVariable("Path");














            ScriptSource pythonScript = pythonEngine.CreateScriptSourceFromFile(@"..\..\..\PythonScripts\");

            var scope = pythonEngine.CreateScope();


            object result = pythonScript.Execute(scope);



Can anyone please share if there is any solution to this problem? Or if there is any specific version of .Net Framework or Anaconda or IronPython that works together?





This e-mail, including any attached files, may contain confidential and privileged information for the sole use of the intended recipient. Any review, use, distribution, or disclosure by others is strictly prohibited. If you are not the intended recipient (or authorized to receive information for the intended recipient), please contact the sender by reply e-mail and delete all copies of this message.

Join to automatically receive all group messages.