Compile 0.20 with python 3.11 on ubuntu (20.04.)

Having trouble installing or compiling FreeCAD? Get help here.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
MarkusH
Posts: 2
Joined: Sat Mar 11, 2023 8:54 am

Compile 0.20 with python 3.11 on ubuntu (20.04.)

Post by MarkusH »

Hi all,

the changelog for 0.20.2 release states that a fix to "make FreeCAD 0.20.x to compile with Python 3.11" is included.
I am trying to compile FreeCAD 0.20 on ubuntu (20.04.) but it seems not to be possible to resolve the dependencies Shiboken2 and PySide2 which are both not compatible with Python 3.11

I would very much be interested in the ability to build upon python 3.11 because I am accessing FreeCAD from a host program which for performance reasons uses python 3.11. Unfortunately I would also need to use the FreeCAD GUI libaries, so I can not compile without GUI support.

I did not find any hints for compiling with python 3.11 on ubuntu in this forum or elsewhere but I see that the Mac distribution has a py311 pre-build.

Best and thanks for any hints,

Markus
User avatar
adrianinsaval
Veteran
Posts: 5541
Joined: Thu Apr 05, 2018 5:15 pm

Re: Compile 0.20 with python 3.11 on ubuntu (20.04.)

Post by adrianinsaval »

can the conda package work for you? AFAIK FreeCAD compiles fine on 3.11 but for this you need that all the python related dependencies be compiled also for 3.11, if ubuntu does not provide those you can't compile it on that environment.
MarkusH
Posts: 2
Joined: Sat Mar 11, 2023 8:54 am

Re: Compile 0.20 with python 3.11 on ubuntu (20.04.)

Post by MarkusH »

Thanks adrian! Just saw there is a release candidate for 0.21 with python 3.11 for linux on conda. Did not work for me, because conda complains about "freecad -> python[version='>=2.7,<2.8.0a0|>=3.10,<3.11.0a0|>=3.9,<3.10.0a0|>=3.8,<3.9.0a0|>=3.7,<3.8.0a0|>=3.6,<3.7.0a0|>=3.5,<3.6.0a0']
". Which seems to indicate that python 3.11 is not supported.
For now I decided to use the conda package with python 3.10 which seems to work fine for me. The hint with conda was of great help considering the efforts when compiling myself. Thanks again!
User avatar
adrianinsaval
Veteran
Posts: 5541
Joined: Thu Apr 05, 2018 5:15 pm

Re: Compile 0.20 with python 3.11 on ubuntu (20.04.)

Post by adrianinsaval »

What command did you use to install freecad in conda? or are you trying to build a conda package? you might just need to go to the dev version of it rather than the stable one. Or maybe the requirements just weren't updated for 0.20 on conda and it can actually work on 3.11 if you bypass this.
Post Reply