KiCad on Fedora 27 - no python scripting functionality

I’ve been trying to get python scripting to work with my installation of KiCad 4.0.7 on Fedora 27. I am using a build from the Fedora repository, and there seems to be no option to open a Python console from pcbnew (it’s not in the “Tools” tab), and when I try to run any script from the internet (e.g. anything from the kicad_mmccoo library https://github.com/mmccoo/kicad_mmccoo), I get:

“ImportError: No module named pcbnew”

I tried reinstalling the package, updating the package, using a copr version (it says that it’s the same as the stable one in the main repo). Finally, I installed the flatpak version from KiCad’s vebsite, it also has the same issue.

What am I doing wrong? Apparently scripting functionality has been added to Fedora’s KiCad build, according to https://bugzilla.redhat.com/show_bug.cgi?id=1364727 and the fedora build’s github (on Jan 11 2015).

Am I doing something wrong? Is there anything else I could try?

Have a look at help->copy version info. You might notice a line KICAD_SCRIPTING=OFF.

I am sure the fedora packaging guys have a reason why they do not enable python scripting under fedora. Maybe look at the bugtracker or ask over at the mailing list if you want to know the reason.

The bug report you referenced is for fedora 24. I would guess newer fedora versions have newer libs which might not be compatible with kicad any longer.
You could look into nightly builds but be aware that these come with their own problems

Wow, that was a quick answer, thank you Rene.

Indeed, the info says:

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=OFF
KICAD_SPICE=OFF

I’ve asked on the Fedora forum, I’ll see what they have to say. Apart from building my own version from source, is there something I could do to add the scripting functionality to an existing installation?

The fedora forum might not be the right place. Might be a better idea to look at the kicad bugtracker
As a last resort you could also try the launchpad mailing list

Also, the build settings above are for the nightly builds. I’ll try the bugtracker as well, thanks.

Since python scripting isn’t officially supported in kicad, it is kept off in fedora. Fedora packages software with default configuration only.

http://docs.kicad.org/doxygen/md_Documentation_development_compiling.html:

Scripting Support

The KICAD_SCRIPTING option is used to enable building the Python scripting support into Pcbnew. This options is enabled by default.
Scripting Module Support

The KICAD_SCRIPTING_MODULES option is used to enable building and installing the Python modules supplied by KiCad. This option is enabled by default.
wxPython Scripting Support

The KICAD_SCRIPTING_WXPYTHON option is used to enable building the wxPython interface into Pcbnew including the wxPython console. This option is enabled by default.

But maybe this is true only for the current HEAD and not for 4.0.7?

Neat, the last time I looked at the build instructions they still recommended python scripting OFF. I don’t know if the v4 package in fedora will every be updated, but if it is it should (finally) include all of the python stuff.

I built v5 in fedora with python scripting on, and haven’t noticed any issues. Hopefully v5 is really out soon so everyone can be on the same level.

1 Like

I was wondering the same thing. I changed from building the nightlies myself and when I updated to Fedora 27 I started using @kicad / kicad Copr for the nightlies.

Here is the first sentence copied from the link:

Description

This is a nightly built repository for KiCad http://www.kicad.org/ with wxPython and wxGTK3(gtk2 based) and python scripting enabled.

I’ll give them a while longer and then go back to building the nightlies myself.

I was no help, but feel your pain.

David

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