Pythonnet problem importing modules on MAC #2366
Unanswered
FutureAIGuru
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
In windows, I put my .py files in the same folder as the c# .exe and the system has no problem with the line:
When I run on the MAC, the same line fails with a module “No module named…”. I don’t quite understand how pathing works within pythonnet. Even under windows, a line:
fails when the script is called from c# but works properly when the script is run directly in python.
I have tried using pythonengine.PythonPath= to set to the folder where all the files exist but no help. I have tried setting environment variables for path and pythonpath but no help. I have tried packaging and pip installing my .py files and then imports work properly. But is clearly the wrong way to do things. I have read all the docs I could find related to pythonnet and/or python pathing but couldn’t’ find a solution.
Clearly, there is a pathing issue but I can’t figure out how and where to set the paths to make things work.
Any insight would be greatly appreciated.
All reactions