Could someone explain how to use the Python interface using a KiCad Nightly build?
Since the KiCad binaries have the -nightly postfix I’m not able to import pcbnew anymore. As soon as the KiCad release version is installed it works fine but I’d like to check a few scripts using the Nightly version to make sure everything runs fine.
I already checked if I’ve to import something like pcbnew-nightly but non if it is available.
Out of curiosity, where on the system am I able to find the Python interface? I printed the import paths from the Python console and couldn’t find any KiCad related in any path.
Sorry, I wasn’t aware of this. Is there any way to receive this information on the console without a window manager? We’ve KiCad running headless on a server installation.
You can always use something like xpra with xvfb to launch fake X session and connect to it, run kicad there. I don’t know if it’s possible to do from console only.
But if you specify exactly which repo you got your nightly from and what is the version info of the package that should be enough.
If you used kicad-5.1 ppa you wouldn’t have ended up with 5.0.2.
Anyway, both of those repositories provide packages with python support. Just make sure to use python3, not python2. pcbnew module will be installed in python3 dist-packages.
@qu1ck your’re right, I actually installed 5.1.2 from the PPA not 5.0.2
Anyway, still working on getting the nightly running
It looks like the nightly from js-reynaud/kicad-dev-nightly does not install any Python packages. Thanks for the hint to use Python 3. I checked everything using Python 3 now.
Steps to reproduce
Install latest KiCad nightly from js-reynaud/kicad-dev-nightly
Run python3 console
Type import pcbnew
Hit enter
Result should be ModuleNotFoundError: No module named 'pcbnew'
ls /usr/lib/python3/dist-packages also contains no KiCad / Pcbnew packages.
Are you trying to import in a generic console, not from inside KiCad? The module is in /usr/lib/kicad-nightly/lib/python3/dist-packages/ which apparently isn’t in the search path of python3. You can add it with: