You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I had an issue with Qt libraries issues when calling LabRecorder as a subprocess from python.
When using subprocess.Popen(), the current os.environ variables are passed along.
Unfortunately LabRecorder seems to first lookup Qt libraries in the PATH rather than use those carried on during compilation.
To solve the issue, I manually remove them from the environment
importosfromsubprocessimportPopen, PIPE# we need to strip the PATH variable of any pyqt reference passed on when opening the pipe!env_dict=dict(copy.deepcopy(os.environ))
pth=env_dict.get("PATH")
pth=";".join([sforsinpth.split(";") ifs.lower().find("pyqt") <0]) # remove qtprint(f"new path without qt: {pth}")
forkey, valinenv_dict.items():
print(f"{key}: {val}")
# here are the culprit that breaks qt from working on the called executableif"QT_PLUGIN_PATH"inenv_dict.keys():
delenv_dict["QT_PLUGIN_PATH"]
if"QML2_IMPORT_PATH"inenv_dict.keys():
delenv_dict["QML2_IMPORT_PATH"]
Then I can call the subprocess with the altered environment variables
I had an issue with Qt libraries issues when calling LabRecorder as a subprocess from python.
When using
subprocess.Popen()
, the currentos.environ
variables are passed along.Unfortunately LabRecorder seems to first lookup Qt libraries in the PATH rather than use those carried on during compilation.
To solve the issue, I manually remove them from the environment
Then I can call the subprocess with the altered environment variables
Here is the fix, in case nothing can be done :)
The text was updated successfully, but these errors were encountered: