Differences between freecad stable and daily PPAs

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
Bayesian
Posts: 81
Joined: Thu Aug 08, 2019 1:49 pm

Differences between freecad stable and daily PPAs

Postby Bayesian » Thu Mar 26, 2020 5:01 pm

I'm trying to make my Jupyter integration work with both stable and daily. Stable works fine, currently.

What the "kernel" does is to configure an IPyKernel application, using PyQt5 integration, and adding "/usr/lib/freecad/","/usr/lib/freecad/lib/" and "/usr/lib/freecad/Ext" to the Python path. Then I can import FreeCAD, FreeCADGui, shuffle the stdoutput streams a little, and optionally show the main window.

With FreeCAD stable I get some error messages about trying to import PySide2. However, the FreeCAD window appears to work normally, with all Workbenches...

With FreeCAD daily the Window is blank and does not seem to load any Addons or Workbenches. No error messages, though.

Any idea how to properly start FreeCAD daily from the system Python interpreter?
vocx
Posts: 3988
Joined: Thu Oct 18, 2018 9:18 pm

Re: Differences between freecad stable and daily PPAs

Postby vocx » Thu Mar 26, 2020 6:27 pm

Bayesian wrote:
Thu Mar 26, 2020 5:01 pm
I'm trying to make my Jupyter integration work with both stable and daily. Stable works fine, currently.
...
Which stable and which daily? You don't even mention your system specifications: Std_About.

The FreeCAD stable repository has the current stable released package, which is 0.18.4.

The FreeCAD daily repository has builds of the current master branch which is the development branch, 0.19. Right now it's in commit 20286.

So, what is the difference? The difference is more than 4000 commits from one version to the other! That's a huge difference!
Always add the important information to your posts if you need help.
To support the documentation effort, and code development, your donation is appreciated: paypal.
Bayesian
Posts: 81
Joined: Thu Aug 08, 2019 1:49 pm

Re: Differences between freecad stable and daily PPAs

Postby Bayesian » Thu Mar 26, 2020 7:00 pm

Yes, I figured this might be a big difference.

I'm using Ubuntu 19.10, with FreeCAD stable and daily from the PPA.

I wondered if a developer could help me figure out how to run FreeCAD from a Python script. There is a way that more or less works with FreeCAD stable (minus some Workbenches that require pyside2). But it doesn't work for the daily PPA version.

One alternative may be to start FreeCAD with the normal binary, then turn it into a IPyKernel application with an autostart script.
User avatar
sgrogan
Posts: 5805
Joined: Wed Oct 22, 2014 5:02 pm

Re: Differences between freecad stable and daily PPAs

Postby sgrogan » Thu Mar 26, 2020 9:13 pm

Bayesian wrote:
Thu Mar 26, 2020 7:00 pm
But it doesn't work for the daily PPA version.
Try to in all your sys.paths replace freecad with freecad-daily, this is the trick used to let freecad and freecad-daily coexist.
Bayesian
Posts: 81
Joined: Thu Aug 08, 2019 1:49 pm

Re: Differences between freecad stable and daily PPAs

Postby Bayesian » Fri Mar 27, 2020 3:51 pm

Try to in all your sys.paths replace freecad with freecad-daily, this is the trick used to let freecad and freecad-daily coexist.
Yes, that was the first thing I did. And I can import FreeCAD this way, no problem. Problem is, however, that I can't open the main window:

I ran the following script through the Appimage. I extracted the image and then ran "./AppRun python kernel.py". And yes, I confirmed this is the correct Python interpreter (3.8 inside the image) and the PYTHONHOME is set to the squashfs-root folder.

Code: Select all

import sys
base = "/home/andreas/cad/squashfs-root/usr/"
sys.path.append(base)
sys.path.append(base+"lib")
import FreeCAD
import FreeCADGui
FreeCADGui.showMainWindow()
print("The End")
From prior debugging I know that the imports are all Ok, and I can create shapes with the Part module for example. But this script does not print anythign, it just flashes a black window for a millisecond and exits. For FreeCAD 0.18, this was enough...