How to open Python console with Kicad5 on Linux

Dear all,
I have installed Kicad5 on Fedora 28 from Rawhide repository.
This was mandatory to get DRC check working (broken on Kicad4.0.7 with FC28).

Now, I would like to use the python scripting and according to the documentation, I should see
“scripting console” in teh “tools” menu.
I don’t have such an entry on my version of kicad.

Do I need to install some dependencies to get it working or it is just that the feature has not been switched ON during compilation step ?

Well, I have the answer in the “info” menu :

Build settings:
USE_WX_GRAPHICS_CONTEXT=OFF
USE_WX_OVERLAY=OFF
KICAD_SCRIPTING=OFF
KICAD_SCRIPTING_MODULES=OFF
KICAD_SCRIPTING_WXPYTHON=OFF
KICAD_SCRIPTING_ACTION_MENU=OFF
BUILD_GITHUB_PLUGIN=ON
KICAD_USE_OCE=ON
KICAD_USE_OCC=OFF
KICAD_SPICE=OFF

So, the new question is :
Could we have a released version with these options switched ON ?

Thanks in advance
Marc

In short, no for the current 5.0, yes for the (hopefully near) future 5.1.

1 Like

Many thanks.
I will try to recompile with the options ON.
Good exercise anyway.

Best regards
Marc

There is a reason the option is off. Your distribution might be one of the (now majority) no longer shipping wxpython compiled against gtk2.

OK, thanks.
By the way, it seems that recompile is not a good idea…
Lot of wx warnings at startup of pcbnew and at the end :
“Error : enable to create the Python Console”
It seems that it is above my competences.

I will duplicate my layouts by hand… It will be faster.
I guess that this feature will be available again in a future release.

Thanks again for the great job which allow us to make pretty nice PCBs with open-source software.
Best regards
Marc

Yes the reason for the 5.1 release is to get back python support for linux

There are two problems at play here:
First of all, the maintainer of the Fedora package refuses to enable Python support, because he does not want to add a dependency on an “ancient Python version that’s going to be removed”
Secondly, even if Python support was enabled, the Scripting Console requires a GTK2 version of wxPython which is not available in the Fedora repositories anymore (as Rene has already mentioned).

If you are looking for a KiCad nightly with both Python support and the Scripting Console enabled, have a look at my kicad-nightly copr.
You can also get stable 5.0.0 with Python support enabled (but without the Scripting Console) from my kicad-release copr.

The question is, why would anyone want to add such a dependency. See https://pythonclock.org/.

1 Like

An even better question is has a migration from Python 2.x to 3.x been submitted as a feature request? I did a quick search on the bug tracker and couldn’t find anything. But I don’t know if my search-fu was adequate, nor if I searched closed (rejected?) feature requests.

I know I was baffled when I heard about the new Python scripting and then finding it was Python2 instead of Python3…

2 Likes

I’m not sure but I think it’s about wxWidgets, the version used in KiCad isn’t compatible with python 3.

Well, I wouldn’t have wanted to generate such a harsh discussion on Python in this thread…
Perhaps there is a clever way to do what I wanted : automatically duplicate the placement (at least) of components contained in a sheet according to the manually placement done on a reference sheet.
I have 5 identical sheets in a hierarchical design.
I have tried a “simple” C code on the kicad_pcb file but it seems that I don’t master all subtleties of the pcb encoding…

Best regards
Marc

You can try using Replicate layout: Action plugin
If you look at the code in replicatelayout.py in test_replicate function you will see how is the code run in standalone (offline) mode

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