Python bindings not available to system python from OS console

There is still the issue with python API not being available to system python from OS console

V6:

$ find /usr -name "*pcbnew.so"
/usr/lib/python3/dist-packages/_pcbnew.so

V7:

$ find /usr -name "*pcbnew.so"
/usr/lib/kicad/lib/python3/dist-packages/_pcbnew.so

On win 10, similarly, more than half of the plugins in v7 do not work

This is likely due to the python API changes. As a plugin writer, I first have to setup plugin development environment under V7 before I start fixing the plugins to work with V7.

Did I understand that closer to the 8th version, all plugins will be set up and then everything is new? Change the format of plugin API change libraries?))

I don’t know if I understand what you are alluding to, so we might need a bit more words to understand each other properly.

Furthermore, I can only speak for my plugins. And for them, I expect that I’ll finish fit the porting of my plugins in a week or so.

Judging by the tests, all plugins made on the python without updating do not work in v7… I am not a programmer and I cannot say for sure share my observations

Yeah that is to be expected as the python API changes quite significantly. But plugin authors tend to update the plugins, and I know some of them are already V7 compatible. You will need to update the plugins though. But I imagine that it will not take a year (when V8 is planed for release) for the plugin authors to update them.

I am afraid though that when V8 comes out, we’ll go thorugh the same process again.

Can they be built into the system? As for example, this happened with a file converter from other cad both diagrams and printed circuit boards

Oh, I was fighting this thing too. Thanks for posting this.

How be it was not the first few months without the usual plugins will be tight)

The could, but then the plugin authors would most likely (me included) be the main reason for the delay of the KiCad release.

I personally write and support the plugins as a volunteer effort. I started writing the plugins because I needed the feature in KiCad, but supporting the plugin is an effort to “make the world a better place”. But this effort can quickly be superseded by other aspects of my life, so I maintain the plugins only when I have the time. Without the regard for KiCad release schedule.

Sorry for the using the wrong name.

On Windows things are simpler as KiCad supplies its own python interpreter. So when I used to develop the plugins there it was quite easy to test the business logic of the plugin within PyCharm IDE (or similar) You would just point the IDE to use the KiCad’s interpreter.

On Linux KiCad uses system interpreter and with V6 it used to put the python bindings so that the system interpreter could see them.

With V7 I had to:

  1. add path /usr/lib/kicad/lib/python3/dist-packages to the interpreter (File/Settings/Project/Python Interpreter/Show all/Show interpreter paths/Add)
  2. add environemnt variable LD_LIBRARY_PATH containing paths to /usr/lib/kicad/lib/python3/dist-packages/:/usr/lib/kicad/lib/x86_64-linux-gnu/ to the debug(run) configuration (Run/Edit configuration/Edit environment variables)

Screenshot

S now I have a development environment set up for V7 and it’s time to port the plugins

2 Likes

Thank you very much for this! Unfortunately, I can only make a financial contribution to the development of plugins and do not have sufficient programming knowledge.

The whole problem is that without third-party plugins it is not possible and they are not made by the developers of kicad, so it makes sense to write if they deliberately changed the python api for plugins… Two options remain is a return to version 6 or a long wait for version 7 fixes if they are at all for plugins

For the most part, they do it for themselves and guarantees that they will want to do for version 7 no

There is always a third way. Don’t be so eager when switching Kicad versions. If you switch when x.0.1 version is released, by that time most of the serious/responsible plugin maintainers will release x.0 compatible version. And for those that don’t, this should be a good indicator that it is risky to base your work on their solutions.

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