Python errors after building from master

Having trouble installing or compiling FreeCAD? Get help here.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
falviani
Posts: 253
Joined: Tue May 07, 2019 8:49 pm

Re: Python errors after building from master

Post by falviani »

Hi,

I'm afraid not. It built fine. Won't launch because I get the following error:
15Apr21_AfterLibPackCopy.png
15Apr21_AfterLibPackCopy.png (7.98 KiB) Viewed 975 times
It's getting pretty discouraging; I was a professional programmer for 50 years and never had this much trouble with a project that was not just starting...

Thanks for asking,
Frank
wmayer
Founder
Posts: 20298
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Python errors after building from master

Post by wmayer »

It's getting pretty discouraging; I was a professional programmer for 50 years and never had this much trouble with a project that was not just starting...
But you cannot blame FreeCAD for that. So far there are two problems:
  • The fact that the wrong Qt dlls are loaded if you don't copy them into FreeCAD's bin directory most likely is because some other application must have installed its Qt dlls into C:\Windows\system32. The problem is that in the dll search order of Windows C:\Windows\system32 comes before the PATH environment variable so that other applications with a different Qt version is going to have problems if the dlls are in a different directory than the executable.
  • The issue with the missing plugin is caused by Qt itself. It took me also a while to figure this out when I encountered it.
falviani
Posts: 253
Joined: Tue May 07, 2019 8:49 pm

Re: Python errors after building from master

Post by falviani »

Hi,

"The fact that the wrong Qt dlls are loaded if you don't copy them into FreeCAD's bin" - I took earlier advice and copied the entire contents of the LibPack bin directory into the FreeCAD output directory. I had hoped to avoid this type of conflict.

"The issue with the missing plugin is caused by Qt itself. It took me also a while to figure this out when I encountered it." - is there a reasonable solution to this? It seems fundamental enough that the generous soul who maintains the LibPack would have implemented a solution.

Thanks for keeping up the dialog,
Frank
wmayer
Founder
Posts: 20298
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Python errors after building from master

Post by wmayer »

According to your screen shot it says that it found the platform plugins: direct2d, minimal, offscreen, webgl and windows. So, everything is there but it still doesn't start and I don't know if this is related to the first problem with the wrongly loaded Qt version.

What happens if you create the file qt.conf in the bin directory with this content:

Code: Select all

[Paths]
Prefix=..
Then you should have a look at C:\Windows\system32 if you can see any Qt dlls (Qt5Core.dll, Qt5Gui.dll, ...) there.
falviani
Posts: 253
Joined: Tue May 07, 2019 8:49 pm

Re: Python errors after building from master

Post by falviani »

Hi,

That file already exists. The contents are:

Code: Select all

[Paths]
Documentation=../../Docs/Qt-5.15.1
Examples=../../Examples/Qt-5.15.1
Prefix=..
There are no QT dlls in the C:\Windows\System32 directory.

The \bin directory in the output build directory contains a large number of Qt dlls, including Qt5Core.dll

One more small step on the path...
Frank
User avatar
sgrogan
Veteran
Posts: 6499
Joined: Wed Oct 22, 2014 5:02 pm

Re: Python errors after building from master

Post by sgrogan »

falviani wrote: Fri Apr 16, 2021 2:13 pm One more small step on the path...
Can you try copying the contents of the Libpack plugins directory to the bin directory of your build?
"fight the good fight"
falviani
Posts: 253
Joined: Tue May 07, 2019 8:49 pm

Re: Python errors after building from master

Post by falviani »

Hi sgrogan,

T;hanks for the suggestion. I just tried that. The splash screen came up, and then nothing happened. Task manager shows the app is not running.

Perhaps 1 step forward, 1 step to one side?

Frank
User avatar
sgrogan
Veteran
Posts: 6499
Joined: Wed Oct 22, 2014 5:02 pm

Re: Python errors after building from master

Post by sgrogan »

falviani wrote: Fri Apr 16, 2021 4:31 pm Perhaps 1 step forward, 1 step to one side?
Next, try copying the resources and translation directories of the Libpack to the the build directory as siblings to bin.
Eventually we will need to figure out why the CMake options that do this are not available to you.
"fight the good fight"
falviani
Posts: 253
Joined: Tue May 07, 2019 8:49 pm

Re: {SOLVED] Python errors after building from master

Post by falviani »

Hi SGrogan,

That did it - it now completes opening! In fact, until now I've been unable to use the draft workbench for resizing - I think there was an incompability with my video drivers that now seems to be fixed.

The next step for you real developers is to figure out the 1-line fix :D that will take care of this, so others can proceed smoothly :P

Thanks ever so much for your patience!
Frank
User avatar
sgrogan
Veteran
Posts: 6499
Joined: Wed Oct 22, 2014 5:02 pm

Re: Python errors after building from master

Post by sgrogan »

falviani wrote: Fri Apr 16, 2021 5:27 pm Thanks ever so much for your patience!
That's great :D
If you don't mind staying involved in this thread maybe we can figure out the CMake issue.
It turns out the fix was to manually do what CMake does if you could set the appropriate switches.

I'll try a scratch build and may have some questions.
"fight the good fight"
Post Reply