1

I want to use some python files in a Visual Studio WPF application, using this code.

var ipy = Python.CreateRuntime();
dynamic test = ipy.UseFile("Test.py");
string whatever = test.pythonString()
MessageBox.Show(whatever);

where Test.py looks like this:

def pythonString:
   return "Whatever"

everything works as expected but if I add any import like

from moviepy.editor import *

to the python code the messagebox doesn't appear. Why does this happen and what do I have to change in order to make python work in Visual studio with libraries?

EXTRA INFO: I use Visual Studio 2015 on Windows 7.

I set up IronPython like this: https://blogs.msdn.microsoft.com/charlie/2009/10/25/running-ironpython-scripts-from-a-c-4-0-program/

denfromufa
  • 5,610
  • 13
  • 81
  • 138
Oscar Johansson
  • 135
  • 1
  • 2
  • 11
  • you need to install `pip install moviepy`, but it does not work on IronPython! So try pythonnet (Python for .NET) from CPython. – denfromufa Oct 06 '16 at 14:24

0 Answers0