Embedded Python Interpreter+CLR: Fails to find module on second run?

235 views Asked by At

So i have an application with an embedded Python interpreter.

We start with Py_Initialize, and when the script is run we spawn a new Interpreter with Py_NewInterpreter.

We execute the script below to use some 3rd party API's and it works great importing our Keysight.DigitalTestApps.Framework.Remote.dll that is provided.

clr.AddReference("Keysight.DigitalTestApps.Framework.Remote")
from Keysight.DigitalTestApps.Framework.Remote import *

We can use the API and everything works.

Without killing the interpreter or anything, the second time we run the script we get an error

"ImportError: No module named Keysight.DigitalTestApps.Framework.Remote"

I'm at a bit of a loss why every other python library and external library we use does not have this problem, but as soon as we include this library it has this issue.

If i remove the use of that dll i can run our script as many times as i want with no issues.

0

There are 0 answers