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

Having trouble installing or compiling FreeCAD? Get help here.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
User avatar
Yinameah
Posts: 46
Joined: Tue Feb 10, 2015 2:00 pm
Location: Fully, Wallis, Switzerland

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

Post 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)
rradler
Posts: 21
Joined: Sun Feb 03, 2019 10:49 am

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

Post 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.
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

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

Post 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 ?
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
Post Reply