Bulding Kicad 5rc2 on Debian testing



As kicad 4.0.7 is currently broken on Debian/testing, I have tried to build 5.0rc2 from sources and cmake aborts with:

CMake Error at CMakeLists.txt:707 (message):

wxWidgets and wxPython use different toolkits (gtk2 vs gtk3). It will
result in a broken build. Please either install wxPython built using gtk2
or add ‘-DKICAD_SCRIPTING_WXPYTHON=OFF’ to cmake parameters to disable
wxPython support.

I have tried to check if one or more libraries were unavailable without any success:

hilbert:[~] > dpkg-query -l | awk '/wxWidget/ { print $2; }'
hilbert:[~] > dpkg-query -l | awk '/wxPython/ { print $2; }'

I know that kicad wants gtk2. libwxgtk3.0-0v5 seems to be built against gtk2 (package provides libwx_gtk2u*.so librarires). But python-wxgtk3.0-dev is built against gtk3.

I have checked in package sources (https://packages.debian.org/experimental/kicad) and I have exactly the same list of installed dev packages.

If I add -DKICAD_SCRIPTING_WXPYTHON=OFF to cmake command line, I’m able to build Kicad. eeschema runs fine, but I have no icon in pcbnew (and the obvious message “no image handler for type 15 defined”).

Is there any hope to build kicad 5.0rc2 on debian testing ?

Best regards,



The wxpython/gtk3 issue is a thorny problem which the devs were hoping to put off until later, but it’s increasingly a problem with distros pushing gtk3

I believe the only workaround is to disable KICAD_SCRIPTING_WXPYTHON as you have done, but there is much more discussion on the developer mailing list. Most recent discussion https://lists.launchpad.net/kicad-developers/msg35370.html


Thanks a lot for your answer.

I will build Kicad without wxpython.

But why have all the icons disappeared from pcbnew toolbars and menus (and only from pcbnew). I have installed rc1 with debian package in /usr and rc2 is installed in $HOME/git/kicad-bin.




I don’t know, something to do with wxpython/gtk mismatch. There is a workaround for that too I think, I don’t recall exactly what.

I have a feeling the devs need to get a solution into v5, otherwise it’s an ongoing problem. The solution isn’t easy though, and means changing a lot of python support.


After reading this:
Which has the title:

Bug#895008: kicad: can’t start pcbnew
I decided to press “Continue” instead of “stop”.
After 350 button presses I got through and PCBnew started.
Almost all icons were missing, and the window for selecting the layers was also missing.
My best guess is that the icons are drawn by the conflicting wxWidgets-python stuff.
EEschem seems to start normally, But I believe there is no python scripting in EEschem.

I’m also Running Debian Testing (Buster) with KiCad V4.0.7 here.
I may be Installing Arch this weekend…


Which also has same problem!


I have tried to find a workaroud to obtain usable pcbnew (with icon and without segfault when I left application…) without success…


As you have correctly noticed, it is a mismatch between wxWidgets (GTK2) and wxPython (GTK3). As there are some problems with GTK3 based libraries, the ideal solution is to use wxWidgets/GTK2 and wxPython/GTK2, but the newest Debian and Ubuntu releases provide only wxPython/GTK3 packages.

At the moment one can either disable wxPython when building KiCad (-DKICAD_SCRIPTING_WXPYTHON=OFF cmake option) or install wxPython/GTK2, but it has to be compiled from scratch as it is not available anywhere according to my knowledge. We do not have a better solution yet, it is a hard nut to crack.


In Arch the problem is relatively easy to solve: either degrade wxpython to or install wxpython-gtk2 from AUR.


When I installed Debian Buster a few weeks ago I did it on a separate partition of my SSD.
The easiest workaround for me is therefore to simply boot into the old Mint 17.3 partition which I still have.
because /home is the same (a 2 TB HDD) I also have no problems with finding my own files back etc.
I did just that, and PCBnew runs fine with Mint 17.3. (also after apt udate/upgrade).


I have rebuild wxPython grom sources and now, I can build kicad 5rc2 with -DKICAD_SCRIPTING_WXPYTHON=ON. Icons are now in pcbnew toolboxes but I have noticed three bugs :
1/ when pcbnew is opened, I have no link between pcbnew and eeschema (when I select a part in pcbnew, component is not shown in eeschema). More generally, I cannot modify schematic when pcbnew is running.
2/ when I close pcbnew, kicad crashes with :
Traceback (most recent call last):
File “”, line 3, in
File “/home/bertrand/git/kicad-bin/lib/python2.7/dist-packages/pcbnew.py”, line 1511, in
traceFindReplace = cvar.traceFindReplace
AttributeError: Unknown C global variable ‘traceFindReplace’
free(): invalid pointer
3/ I have a lot of messages in console :
(kicad:8153): GdkPixbuf-CRITICAL **: 16:49:58.127: gdk_pixbuf_calculate_rowstride: assertion ‘width > 0’ failed

(kicad:8153): GdkPixbuf-CRITICAL **: 16:49:58.127: gdk_pixbuf_get_has_alpha: assertion ‘GDK_IS_PIXBUF (pixbuf)’ failed

(kicad:8153): GdkPixbuf-CRITICAL **: 16:49:58.127: gdk_pixbuf_scale: assertion ‘GDK_IS_PIXBUF (src)’ failed

(kicad:8153): GLib-GObject-CRITICAL **: 16:49:58.127: g_object_unref: assertion ‘G_IS_OBJECT (object)’ failed

Best regards,



Found and solved.

Building kicad against wxPython-gtk2 is not enough, wxPython-gtk3 has to be removed from system.

Best regards,



This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.