try to load ngsolve in StartGUI python script (fixes failing ngsolve load from tcl in python packages)

This commit is contained in:
mhochsteger@cerbsim.com 2022-02-16 09:22:21 +01:00
parent 15efa3a8b7
commit 6f4cc7c528
2 changed files with 7 additions and 4 deletions

View File

@ -12,10 +12,6 @@ def main():
# Use Redraw without event handling
netgen.Redraw = netgen._Redraw
try:
import ngsolve
except:
pass
from .gui import win
th = threading.Thread(target=handle_arguments)
th.start()

View File

@ -2,6 +2,13 @@ import netgen
def StartGUI():
from tkinter import Tk
try:
# the GUI tries to load ngsolve.tcl (which loads ngsolve shared libraries)
# BUT might fail to load dependencies (like mkl), these are handled by the
# ngsolve __init__.py script, so import ngsolve from python already here
import ngsolve
except:
pass
global win
win = Tk()