Python scripting missing on Fedora 27

Asked by M

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/kicadmmccoo), I get:

"ImportError: No module named pcbnew"

I tried reinstalling the package, updating the package, using a nightly build. Finally, I installed the flatpak version from KiCad's vebsite, it also has the same issue. I

What am I doing wrong? Apparently scripting functionality has been added to Fedora's KiCad build, according to https://bugzilla.redhat.com/show_bug.... and the fedora build's github (on Jan 11 2015), but then the version info says:

Build settings: USEWXGRAPHICSCONTEXT=OFF USEWXOVERLAY=OFF KICADSCRIPTING=OFF KICADSCRIPTINGMODULES=OFF KICADSCRIPTINGWXPYTHON=OFF KICADSCRIPTINGACTIONMENU=OFF BUILDGITHUBPLUGIN=ON KICADUSEOCE=OFF KICADSPICE=OFF

Am I doing something wrong? Is there something I could do to add the functionality to an existing installation? I don't think I'd be able to build it from source myself.

Question information

Language:
English Edit question
Status:
Solved
For:
KiCad Edit question
Assignee:
No assignee Edit question
Solved by:
Aimylios
Solved:
Last query:
Last reply:
Revision history for this message
Alain Portal (alain-portal) said :
#1

Unfortunately, scripting functionality has NOT been added to Fedora's KiCad build, according to https://bugzilla.redhat.com/show_bug.cgi?id=1364727 (bz #1364727). The Fedora packager clearly choose to do not set up the functionality.
This is probably a packager who don't use Kicad...

So, if you want the scripting functionality, you have no other choice than building by yourself (French adage : « On n'est jamais mieux servi que par soi-même »), after reading the Documentation/compiling.md file, particulary the « # Building KiCad on Linux # {#build_linux} » section.

Another solution is to patch the kicad.spec file from Fedora, according the file attachement of the https://bugzilla.redhat.com/show_bug.cgi?id=1364727

Revision history for this message
Best Aimylios (aimylios) said :
#2

You can get a release build of KiCad 5.0.0-rc1 with Python scripting enabled from my personal Copr repository:
https://copr.fedorainfracloud.org/coprs/aimylios/kicad-release/

I have also proposed to enable this feature in the nightly builds provided via the @kicad/kicad Copr, but this change is still awaiting approval.

Revision history for this message
M (s1512783) said :
#3

Thanks Aimylios,
I did the thing I needed by hand, I only needed to copy the same module 7 times, so I did not really need it, I just wanted to learn how to use it. Where can I track your proposal for the mainstream copr repository?

Revision history for this message
M (s1512783) said :
#4

Thanks Aimylios, that solved my question.

Revision history for this message
Aimylios (aimylios) said :
#5

You can track the current status of the official @kicad/kicad Copr repository via GitHub:
https://github.com/KiCad/fedora-packaging

My latest pull request includes, amongst other things, a change to enable Python scripting support:
https://github.com/KiCad/fedora-packaging/pull/13

Unfortunately it is currently not possible to build KiCad with wxPython on Fedora. Although it is not strictly required for Python scripting support itself, some features will not be available without it (like the scripting console).