Failed to initialise Shiboken.BaseWrapper type

Having trouble installing or compiling FreeCAD? Get help here.
axk
Posts: 20
Joined: Fri Jan 24, 2014 9:29 am

Failed to initialise Shiboken.BaseWrapper type

Postby axk » Sat Mar 04, 2017 8:18 am

Hello,

I just did a git pull and a clean build. Compilation was clean and uneventful, however I get this error when starting up:

Code: Select all

FreeCAD 0.17, Libs: 0.17R10411 (Git)
© Juergen Riegel, Werner Mayer, Yorik van Havre 2001-2017
  #####                 ####  ###   #### 
  #                    #      # #   #   #
  #     ##  #### ####  #     #   #  #   #
  ####  # # #  # #  #  #     #####  #   #
  #     #   #### ####  #    #     # #   #
  #     #   #    #     #    #     # #   #  ##  ##  ##
  #     #   #### ####   ### #     # ####   ##  ##  ##

Fatal Python error: [libshiboken] Failed to initialise Shiboken.BaseWrapper type.
Aborted


Any advice on where to begin debugging this? Is my local shiboken at fault?
I am running the stock libs installed that are available with arch linux:

Code: Select all

local/python-shiboken 1.2.4-3
    Support library for Python bindings
local/python2-shiboken 1.2.4-3
    Support library for Python2 bindings
local/shiboken 1.2.4-3
    CPython bindings generator for C++ libraries


Am I on an old version of some python collateral?

thanks in advance
looo
Posts: 672
Joined: Mon Nov 11, 2013 5:29 pm

Re: Failed to initialise Shiboken.BaseWrapper type

Postby looo » Sat Mar 04, 2017 10:36 am

you have installed shiboken for python2 and python3?
With this commit cmake takes the default config for shiboken and pyside. And maybe in your case this is the python3 version...
You can try setting the variables manually:

Code: Select all

cmake
-DPYTHON_SUFFIX=..., #look for this file <ShibokenConfigPYTHON_SUFFIX.cmake>
-DPYTHON_BASENAME=... #look for this file <PySideConfigPYTHON_BASENAME.cmake>


ps.: maybe you can try this branch. There the behavior is revered for python2.
triplus
Posts: 4833
Joined: Mon Dec 12, 2011 4:45 pm

Re: Failed to initialise Shiboken.BaseWrapper type

Postby triplus » Sat Mar 04, 2017 12:41 pm

Hopefully commit by @looo will sort it out. But if it won't am i correct in guessing you are trying to build against Qt 5? If yes this is what i had to use in the past:

https://forum.freecadweb.org/viewtopic. ... 20#p121791
axk
Posts: 20
Joined: Fri Jan 24, 2014 9:29 am

Re: Failed to initialise Shiboken.BaseWrapper type

Postby axk » Sat Mar 04, 2017 9:09 pm

looo wrote:you have installed shiboken for python2 and python3?
With this commit cmake takes the default config for shiboken and pyside. And maybe in your case this is the python3 version...
You can try setting the variables manually:

Code: Select all

cmake
-DPYTHON_SUFFIX=..., #look for this file <ShibokenConfigPYTHON_SUFFIX.cmake>
-DPYTHON_BASENAME=... #look for this file <PySideConfigPYTHON_BASENAME.cmake>


ps.: maybe you can try this branch. There the behavior is revered for python2.


Thanks for the suggestion. I will try that. This is what I have currently set:

CMakeLists.txt: SET(PYTHON_SUFFIX -python2.7) # for shiboken
CMakeLists.txt: SET(PYTHON_BASENAME -python2.7) # for PySide
treslah
Posts: 11
Joined: Wed Sep 14, 2016 1:31 pm

Re: Failed to initialise Shiboken.BaseWrapper type

Postby treslah » Mon Mar 06, 2017 8:33 am

Same problem here on Gentoo:
Failed to initialise Shiboken.BaseWrapper type.
shiboken pyside all compiled with py2_7 and py3_5 on the system

Please:
Can please someone advise on exactly howto fix this, or even better: patch it in the source code ?!?
I doubt it'll fix itself as suggested ;-)
wmayer
Site Admin
Posts: 11222
Joined: Thu Feb 19, 2009 10:32 am

Re: Failed to initialise Shiboken.BaseWrapper type

Postby wmayer » Mon Mar 06, 2017 9:24 am

Post the content of the file ShibokenConfig.cmake

For me it is:

Code: Select all

if (NOT PYTHON_SUFFIX)
    message(STATUS "Using default python: -python2.7")
    SET(PYTHON_SUFFIX -python2.7)
endif()
include(/usr/lib/x86_64-linux-gnu/cmake/Shiboken-1.2.1/ShibokenConfig${PYTHON_SUFFIX}.cmake)

This means it sets PYTHON_SUFFIX to -python2.7. So, it's consistent with the Python version FreeCAD is built with.
J.Martinsson
Posts: 3
Joined: Sun Nov 10, 2013 10:48 am

Re: Failed to initialise Shiboken.BaseWrapper type

Postby J.Martinsson » Mon Mar 06, 2017 10:11 am

I have the same problem with Arch Linux. A build for 2-3 weeks ago was fine but not when I did a new build two days ago.
My ShibokenConfig.cmake (/usr/lib/cmake/Shiboken-1.2.4/ShibokenConfig.cmake)

Code: Select all

if (NOT PYTHON_SUFFIX)
    message(STATUS "Using default python: .cpython-36m-x86_64-linux-gnu")
    SET(PYTHON_SUFFIX .cpython-36m-x86_64-linux-gnu)
endif()
include(/usr/lib/cmake/Shiboken-1.2.4/ShibokenConfig${PYTHON_SUFFIX}.cmake)


On my system it locks that it is only freecad (git checkout version of it) which require shiboken (by python2-pyside) so I guess i can change ShibokenConfig.cmake. But is there a better way that not affect other application if the were effected by shiboken?
looo
Posts: 672
Joined: Mon Nov 11, 2013 5:29 pm

Re: Failed to initialise Shiboken.BaseWrapper type

Postby looo » Mon Mar 06, 2017 10:47 am

Which option are you using to run cmake? I wonder because, if python3 is the default version on your system, cmake should use this version by default... and then the build should fail anyway.

Please test if this branch work for you: https://github.com/looooo/FreeCAD/tree/python3-cmake
treslah
Posts: 11
Joined: Wed Sep 14, 2016 1:31 pm

Re: Failed to initialise Shiboken.BaseWrapper type

Postby treslah » Mon Mar 06, 2017 12:41 pm

@wmayer
Shiboken 1.2.2

if (NOT PYTHON_SUFFIX)
message(STATUS "Using default python: -python3.4")
SET(PYTHON_SUFFIX -python3.4)
endif()
include(/usr/lib64/cmake/Shiboken-1.2.2/ShibokenConfig${PYTHON_SUFFIX}.cmake)

I'll set PYTHON_SUFFIX manually an do a new build. I'll report back ....

@looo
Py34 is the default but the emerge script specifies to use py27 for the build. So the build process works. I'll have a look at the log file and report back ...
wmayer
Site Admin
Posts: 11222
Joined: Thu Feb 19, 2009 10:32 am

Re: Failed to initialise Shiboken.BaseWrapper type

Postby wmayer » Mon Mar 06, 2017 1:04 pm

Py34 is the default but the emerge script specifies to use py27 for the build. So the build process works. I'll have a look at the log file and report back ...

In this case you also have to set PYTHON_SUFFIX and PYTHON_BASE in the script.

Please test if this branch work for you: https://github.com/looooo/FreeCAD/tree/python3-cmake

This effectively reverts the recent change when Python 2.x is used. So, when a PR is made this can be merged and the build should work normally again.