module not loading in .py file using netgen in terminal

I am new to ngsolve and I recently received a model from a colleague that uses ngsolve. After installing using pip a demo of the model should be usable by simply saying “netgen” in terminal. is a python file with the code to run the model and calls a module within it. That module is in the same folder as and appears usable in vscode when I am reading the code, however when I run this line in terminal I get the error: “ModuleNotFoundError: No module named ‘magmaxisym’”. If I run the code in vscode this is not an issue, however I don’t have access to the actual geometry so I need to be using ngsolve.
Do you have any suggestions on how to fix this issue? I am using the pip install on a Mac.


Hi, did you also get an additional file “” from your colleague? You need to add the folder of that file to your PYTHONPATH environment variable. you can also run the code in visual studio and add

import netgen.gui

at the top of the file to open the gui from python.

So magmaxiym is a subfolder in the same folder as In the magmaxiysm subfolder there is a file which as I understand it tells python to treat magmaxiysm as a module. So I believe they are already on the same path but I still have this issue.

You need to add “.” to your PYTHONPATH environment variable then.