icon

Support Forum

[Frage] How to get PySide6 work in Allplan2026


Hello all,

We are at the beginning of the development of an interactor script that will be embedding complex GUIs.
For this reason we would like to design the graphical part of the script by using PySide6.

After having installed PySide6 in our Allplan2026 Python3.13 instance, we cannot manage to have have it working, it systematically ends up with an ImportError message :
ImportError: DLL load failed while importing Shiboken : The specified module was not found.

It seems the Python engine embedded in Allplan 2026 cannot load the Qt6 DLLs required by Shiboken6.

Then we tried to

- copy all the necessary DLLs in the path ...\Allplan\Allplan2026\Prg\bin\Qt and reference this in the script using
qt_path = r"...\Allplan\Allplan2026\Prg\bin\Qt"
os.add_dll_directory(qt_path) --> not working...

- copy all the necessary DLLs in the path ...\Allplan\Allplan2026\Prg\Python\DLLs --> not working...

- even copy all the necessary DLLs in the root path ...\Allplan\Allplan2026\Prg --> not working...

Did some of you succeed at running PySide6 inside Allplan PythonPartsScripts and in this case what is the procedure,
or is it simply impossible to have PySide6 running inside Allplan ?

Thanks for your help

Hilfreichste Antwort anzeigen Hilfreichste Antwort verbergen

Zitiert von: uid-401636
Hi,
That's not really our concern.
Actually, PySide6 and shiboken have been installed this way.

A GUI made with PySide6 is correctly launched inside the Allplan2026 Python environment (whose site-packages hase been appended with PySide6 and shiboken),

but as soon as launched inside Allplan2026 the "ImportError" occurs as the Qt6 DLLs required by Shiboken6 seem to be unloadable.
Best

Hello!

I can provide more information on the issue.

The main and presumably relevant thing for this issue, that is different between a clean (e.g. virtual) Python environment and Python environment running inside ALLPLAN are the paths. You can print them with:

import sys
for path in sys.path
    print(path)

Python normally looks for dll's in those paths. Apparently, Shiboken is trying to import a DLL, that is not in these paths or (more likely) a Shiboken's DLL rely on other DLL (which maybe rely on other one, and so on...), that is not in these paths. The problem here is, that we don't know, what DLL fails to be imported (cannot be found) because it's probably a non-python DLL. You can only find it out with a dependency walker. Once you've figured it out and know on which path this DLL is located, you can add the path to the sys.path (or os.add_dll_directory).

I hope, that helps somehow. If you try this approach, I'll be grateful for your feedback.

Cheers,
Bart

Hi,

If you need to install a specific package, please use:

InstallPythonPackage

Best
Christophe

Hi,

That's not really our concern.

Actually, PySide6 and shiboken have been installed this way.
A GUI made with PySide6 is correctly launched inside the Allplan2026 Python environment (whose site-packages hase been appended with PySide6 and shiboken),
but as soon as launched inside Allplan2026 the "ImportError" occurs as the Qt6 DLLs required by Shiboken6 seem to be unloadable.

Best

Same issue here

ImportError: DLL load failed while importing Shiboken: Le module spécifié est introuvable.

in VSCode, ok for autocomplete

Anhänge (1)

Typ: image/png
30-mal heruntergeladen
Größe: 41,72 KiB

Have you made sure that the installed "Shiboken6" version is compatible with your Python version? Could you also share the full trace-output? A small tip: Allplan works with the reloader module. I have had some issues with third party packages, that related to the reloader, so maybe thats something you could investigate...

Same issue here with all Allplan Versions.
It would be great if there was a fix. There is a lot of potential, TKinter is ...meh...

The problem is exclusively with pyside, not with the reloader or the installation of packages in general.

Hi,

There is another example of external dialog box without tkinter

Best

Zitiert von: cmaignan
Hi,
There is another example of external dialog box without tkinter
Best

Thanks! But python clr+wpf/xaml is even worse and more painful for anything more than a dialog box.
When we talk about the usage of pyside, we dont talk about file dialogs or input masks for some length values. We are talking about the handling and visualization of large data tables. Report creation. Diagramms. Interop with other technologies and services etc. etc..

I appreciate the developments regarding the possibilities with the allplan palette a lot, but I think there are a lot of use cases for pyside many people dont think about without the possibility to test it.

Kind regards

Zitiert von: uid-401636
Hi,
That's not really our concern.
Actually, PySide6 and shiboken have been installed this way.

A GUI made with PySide6 is correctly launched inside the Allplan2026 Python environment (whose site-packages hase been appended with PySide6 and shiboken),

but as soon as launched inside Allplan2026 the "ImportError" occurs as the Qt6 DLLs required by Shiboken6 seem to be unloadable.
Best

Hi,

we will have a look on what is causing the issue. I could reproduce it quite easily, but I ran out of possible fixes and also the error message is not really explicit (no idea, which DLL is missing and where it is being looked for). Clearly it's an issue of the python environment within ALLPLAN, because in a clean virtual environment, no problem occurs.

I will let you know, when we know more.

Cheers,
Bart

Zitiert von: uid-401636
Hi,
That's not really our concern.
Actually, PySide6 and shiboken have been installed this way.

A GUI made with PySide6 is correctly launched inside the Allplan2026 Python environment (whose site-packages hase been appended with PySide6 and shiboken),

but as soon as launched inside Allplan2026 the "ImportError" occurs as the Qt6 DLLs required by Shiboken6 seem to be unloadable.
Best

Hello!

I can provide more information on the issue.

The main and presumably relevant thing for this issue, that is different between a clean (e.g. virtual) Python environment and Python environment running inside ALLPLAN are the paths. You can print them with:

import sys
for path in sys.path
    print(path)

Python normally looks for dll's in those paths. Apparently, Shiboken is trying to import a DLL, that is not in these paths or (more likely) a Shiboken's DLL rely on other DLL (which maybe rely on other one, and so on...), that is not in these paths. The problem here is, that we don't know, what DLL fails to be imported (cannot be found) because it's probably a non-python DLL. You can only find it out with a dependency walker. Once you've figured it out and know on which path this DLL is located, you can add the path to the sys.path (or os.add_dll_directory).

I hope, that helps somehow. If you try this approach, I'll be grateful for your feedback.

Cheers,
Bart