Page 1 of 1

Trouble with compilation on ArchLinux (typeError: type '_io._IOBase' )

Posted: Mon Jan 28, 2019 6:55 pm
by Yinameah
Hello,

I spent some time trying to compile FreeCAD and I run into problems. It's the first time I dig into CMake seriously and I'm still a bit lost, but I have a decent understanding of all the other techs involved.

First, I had trouble to find the proper dependencies. https://www.freecadweb.org/wiki/index.p ... pileOnUnix was not up to date concerning which packages where not available in the main repos.

Using AUR and a lot of trial and error, I finally managed to compile FreeCAD but on startup I get :

Code: Select all

[Error in InitApplications type '_io._IOBase' participates in gc and is a base type but has inappropriate tp_free slot
--------------------------------------------------------------------------------
Traceback (most recent call last):
File "<string>", line 241, in <module>
File "<string>", line 54, in InitApplications
File "/usr/lib/python2.7/io.py", line 51, in <module>
import _io
TypeError: type '_io._IOBase' participates in gc and is a base type but has inappropriate tp_free slot
--------------------------------------------------------------------------------
I saw similar error in the forum thread about Python3 compilation, but I'm not trying to compile with pyhon3 sofar.

I think it's related to pyside/shiboken, because cmake gives me the following while configuring :

Code: Select all

Using default python: .cpython-37m-x86_64-linux-gnu
libshiboken built for Release
Found PySide Tools: /usr/bin/pyside-uic, /usr/bin/pyside-rcc
On the other hand, I succeed to build with "BUILD_QT5=ON". In that case, cmake gives me :

Code: Select all

libshiboken built for Release
PYTHON_CONFIG_SUFFIX: -python2.7
libshiboken built for Release
And everything goes well (At least compilation doesn't fail and freecad doesn't crash at startup)

Any thoughts ? Am I right to think that the problem is because pyside/shiboken use python3 instead of python2 ? Is that because I don't have the right dependencies or because of a FreeCAD cmake configuration issue ?


PS : I cloned the git repository for the sources. (upstream https://github.com/FreeCAD/FreeCAD.git -- branch master)

Re: Trouble with compilation on ArchLinux (typeError: type '_io._IOBase' )

Posted: Wed Mar 13, 2019 6:15 am
by rradler
I had exactly the same problem as you. For compiling freecad I followed the instructions on the freecad wiki. It would then compile without any problems but crash at startup. The "BUILD_QT5=ON" switch made it then start without crashing. I didn't try much with it but as far a I can see there is an issue with some of the icons in the menu bar. But this problem also shows up in the AppImage version with Conda/phyton3.

Re: Trouble with compilation on ArchLinux (typeError: type '_io._IOBase' )

Posted: Mon Jul 22, 2019 11:49 am
by Kunda1
Yinameah wrote: Mon Jan 28, 2019 6:55 pm
rradler wrote: Wed Mar 13, 2019 6:15 am
This looks like a python2/3 issue. Can you try building with python3 instead ?