Can't get Python to work

Hi there! First time here for me.

So I have been developing a VR app to monitor a robot’s performance and status. However, I need to run a Python script right now, to get some specific data. I tried with IronPython and Unity’s own API, but I can’t get it to work. I am able to run the code correctly, but I always get errors regarding imports and references to external files, located in the same folder… The first import I do, regardless of the file I get the error “Could find module XXXX”

Does anybody have a clue what might be happening? I’ve tried both functions attached below now, which have at least given some results and executed the code in the first place. My guess is I am not understanding the out of process API and how to use it. Or is it maybe a code fault on my part?

Thanks a lot in advance

I’m guessing perhaps it is pathing or working directory. If your script runs fine from the shell prompt, try replacing it with a script that prints details about the run environment when launched, such as working directory and environment variables, and write those to a file so you can see them later after invoking them from Unity, perhaps even compare to invoking it from the shell prompt directly.

You may need extra steps in Python to assert the correct import location and a Python website can help you modify that at runtime in a Python script. I think it’s sys.path.insert() but don’t trust me on that.