Problems with installation on Ubuntu 22.04

Having trouble installing or compiling FreeCAD? Get help here.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
Mark_m
Posts: 20
Joined: Wed Dec 05, 2018 7:10 pm

Problems with installation on Ubuntu 22.04

Post by Mark_m »

Hello
Two Problems:
1.
I have updatet to Ubuntu 22.04


OS: Ubuntu 22.04 LTS (ubuntu:GNOME/ubuntu-xorg)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.24366 (Git) AppImage
Build type: Release
Branch: (HEAD detached at 0f9259c)
Hash: 0f9259cda103ae1824ac16c68ac9b4a0d54b05fc
Python version: 3.9.7
Qt version: 5.12.9
Coin version: 4.0.0
OCC version: 7.5.3
Locale: German/Germany (de_DE)


Appimage startet but no functionality works. Can't create a new document or can't open a Part.

2.
After update to Ubuntu 22.04
Freecad from Ubuntu installed with apt.
Freecad works but the Path toolbar dont work.

OS: Ubuntu 22.04 LTS (ubuntu:GNOME/ubuntu-xorg)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.
Build type: Release
Python version: 3.10.2
Qt version: 5.15.2
Coin version: 4.0.0
OCC version: 7.5.1
Locale: German/Germany (de_DE)

A lot of errors comes:

17:09:43 Traceback (most recent call last):
File "/usr/share/freecad/Mod/Path/PathScripts/PathJobGui.py", line 139, in attach
self.axs = coin.SoType.fromName('SoAxisCrossKit').createInstance()
File "/usr/lib/python3/dist-packages/pivy/coin.py", line 491, in createInstance
return _coin.SoType_createInstance(self)
<class 'SystemError'>: <built-in function SoType_createInstance> returned a result with an exception set
17:09:43 centroid_post gcode postprocessor loaded.
17:09:43 centroid_post gcode postprocessor loaded.
17:09:43 PathJobGui.ERROR: <built-in function SoFieldContainer_getField> returned a result with an exception set
17:09:43 SystemError: PY_SSIZE_T_CLEAN macro must be defined for '#' formats
17:09:43
The above exception was the direct cause of the following exception:

17:09:43 Traceback (most recent call last):
17:09:43 File "/usr/share/freecad/Mod/Path/PathScripts/PathJobGui.py", line 1367, in Create
obj.ViewObject.Proxy.editObject(obj.Stock)
17:09:43 File "/usr/share/freecad/Mod/Path/PathScripts/PathJobGui.py", line 202, in editObject
return self.openTaskPanel('Stock')
17:09:43 File "/usr/share/freecad/Mod/Path/PathScripts/PathJobGui.py", line 186, in openTaskPanel
self.showOriginAxis(True)
17:09:43 File "/usr/share/freecad/Mod/Path/PathScripts/PathJobGui.py", line 162, in showOriginAxis
self.switch.whichChild = sw
17:09:43 File "/usr/lib/python3/dist-packages/pivy/coin.py", line 3998, in __setattr__
field = self.getField(name)
17:09:43 File "/usr/lib/python3/dist-packages/pivy/coin.py", line 3873, in getField
return _coin.SoFieldContainer_getField(self, name)
17:09:43 SystemError: <built-in function SoFieldContainer_getField> returned a result with an exception set
17:09:43

Many Thanks in advanced
Mark
andyk
Posts: 11
Joined: Wed Oct 28, 2020 12:48 am

Re: Problems with installation on Ubuntu 22.04

Post by andyk »

I am now getting this same error today after having a week of my setup working on 22.04.
User avatar
adrianinsaval
Veteran
Posts: 5551
Joined: Thu Apr 05, 2018 5:15 pm

Re: Problems with installation on Ubuntu 22.04

Post by adrianinsaval »

are you using the version from the default ubuntu repos? IIRC those were broken although I don't remember if it had these same errors, try with the ppa version if it's available for 22.04 otherwise run the appimage with the workaround mentioned in the known os specific issues post

Code: Select all

LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libstdc++.so.6 ./FreeCAD_weekly-builds-27936-Linux-Conda_glibc2.12-x86_64.AppImage
(adapt the filename of the appimage to the one you have and check that the libstdc++ path is correct for your system)
wmayer
Founder
Posts: 20309
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Problems with installation on Ubuntu 22.04

Post by wmayer »

This is a problem that has started with Py 3.10 and must be handled by pivy
17:09:43 SystemError: PY_SSIZE_T_CLEAN macro must be defined for '#' formats
For more details see: https://bugs.python.org/issue40943

There also was a PR for FreeCAD but we have removed the '#' from PyArg_ParseTuple to avoid to deal with the PY_SSIZE_T_CLEAN.
looo wrote: ping
looo has fixed the pivy code to handle this:
https://forum.freecadweb.org/viewtopic. ... 77#p563177
https://github.com/swig/swig/issues/2150
https://github.com/coin3d/pivy/issues/88
https://github.com/coin3d/pivy/pull/91

So, obviously the pivy version in the Ubuntu repo is broken and the package maintainer should fetch the fixed sources from upstream.
User avatar
looo
Veteran
Posts: 3941
Joined: Mon Nov 11, 2013 5:29 pm

Re: Problems with installation on Ubuntu 22.04

Post by looo »

wmayer wrote: Tue May 10, 2022 8:14 am This is a problem that has started with Py 3.10 and must be handled by pivy
17:09:43 SystemError: PY_SSIZE_T_CLEAN macro must be defined for '#' formats
For more details see: https://bugs.python.org/issue40943

There also was a PR for FreeCAD but we have removed the '#' from PyArg_ParseTuple to avoid to deal with the PY_SSIZE_T_CLEAN.
looo wrote: ping
looo has fixed the pivy code to handle this:
https://forum.freecadweb.org/viewtopic. ... 77#p563177
https://github.com/swig/swig/issues/2150
https://github.com/coin3d/pivy/issues/88
https://github.com/coin3d/pivy/pull/91

So, obviously the pivy version in the Ubuntu repo is broken and the package maintainer should fetch the fixed sources from upstream.
there is a new release which has python3.10 support:
https://github.com/coin3d/pivy/releases/tag/0.6.7
Mark_m
Posts: 20
Joined: Wed Dec 05, 2018 7:10 pm

Re: Problems with installation on Ubuntu 22.04

Post by Mark_m »

adrianinsaval wrote: Mon May 09, 2022 9:23 pm are you using the version from the default ubuntu repos? IIRC those were broken although I don't remember if it had these same errors, try with the ppa version if it's available for 22.04 otherwise run the appimage with the workaround mentioned in the known os specific issues post

Code: Select all

LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libstdc++.so.6 ./FreeCAD_weekly-builds-27936-Linux-Conda_glibc2.12-x86_64.AppImage
(adapt the filename of the appimage to the one you have and check that the libstdc++ path is correct for your system)
The appimage works now!
Thanks a lot!
are you using the version from the default ubuntu repos?
Yes.
But I prefere the appimage. Unfortunality the appimage was broken since some time, as fallback I use the Ubuntu repos.
Now I will use the appimage again
:-)

Many thanks for the fast helping!!
User avatar
dpward
Posts: 27
Joined: Sun Jan 01, 2023 6:06 pm
Contact:

Re: Problems with installation on Ubuntu 22.04

Post by dpward »

wmayer wrote: Tue May 10, 2022 8:14 am So, obviously the pivy version in the Ubuntu repo is broken and the package maintainer should fetch the fixed sources from upstream.
Fix released: https://bugs.launchpad.net/ubuntu/+sour ... ug/2000840
Post Reply