Problem with BOM and Plugins

I can’t seem to generate a BOM or add a plugin. I’m new to KiCad, I have a schematics with no ERC errors (figured that out), and looking to make a BOM file in CSV file. I’ve been to many utube videos and pages on GitHub. Would also like to try Interactive BOM. Do I need to make a PCB first? What could I be doing wrong? Any help would be great! I’m using ver 5.1.5 on Win 10

Usually the plugins provide some examples.
To generate the CSV list, KiCad (Eeschema, the software for schematics) generate a XML output file and convert the data, in your case, to a CSV. If there isn’t any part (components) added to the schematic, the XML file will be not generated, other problem that I realize that the project have to be created (not only open the Eeschema):

  1. Create the project (open the software KiCad);
  2. Add your parts and save (into the Eeschema);
  3. There is a shortcut for “Generate a output bill of materials” in the top side bar;
  4. Choice the xml2csv plugin.

There is also a lot of plugins (you can found here in the forum) that can be installed into Eeschema. I like to use KiCost.

Interactive BOM is a “action plugin” of Pcbnew (KiCad’s software for pcb layout). Just copy the project code into the plugins folder of your KiCad installation (here I will need some Windows user to inform the path).

After design your PCB just click in the icon of Interactive BOM in Pcbnew, the dialog box of the plugin will open.

In the future is planned some easy way to users install the plugins.

The interactive BOM plugin is an extension of pcbnew and really only makes sense if you have a layout (it allows to display your part placements in a browser an easily highlight groups of parts)

For me (5.1.5, Win 7) the Tools->Generate Bill of Materials… then select one of plugins shown in left window and [Generate] button works well.
I probably had to change in Command line the %O to %O.csv (according to instruction in right window). Not sure, as once changed KiCad remembers my setting.
If you don’t change it the csv file is also generated, only had no .csv extension.

I get this in the command line:
Run command:
python “C:\Program Files\KiCad\lib\python2.7\Tools\scripts/” “%I” “%O”

Run command:
python “C:\Program Files\KiCad\lib\python2.7\Tools\scripts/” “C:\Users\MadTo\OneDrive\Email%20attachments\Documents\TSKH11AA1ver2.xml” “C:/Users/MadTo/OneDrive/Email%20attachments/Documents/TSKH11AA1ver2”

Command error. Return code 1
Error messages:
Traceback (most recent call last):
File “C:\Program Files\KiCad\lib\python2.7\Tools\scripts/”, line 72, in
File “C:\Program Files\KiCad\lib\python2.7\Tools\scripts/”, line 34, in main
File “C:\Program Files\KiCad\lib\python2.7\Tools\scripts/”, line 41, in process
names = os.listdir(dir)
WindowsError: [Error 267] The directory name is invalid: ‘C:\Users\MadTo\OneDrive\Email%20attachments\Documents\TSKH11AA1ver2.xml/.

What am I doing wrong?

I see it this way:

And after [Generate] (for one of example PCBs):

Run command:
python “C:\Programy\KiCad\bin\scripting\plugins/” “D:\Mm\KiCad\Tmp\pic_programmer\pic_programmer.xml” “D:/Mm/KiCad/Tmp/pic_programmer/pic_programmer.csv”


I don’t know python.
I don’t know where form you get - I have not it on the list (see screen shot).
‘Email%20attachments’ in your file names suggests me that you don’t work like me at the files at your HDD but you try to use and modify attachments to a mail. Never got such idea that it could be possible.

OK I used this from the list
python “C:\Program Files\KiCad\bin\scripting\plugins/” “%I” “%O”
Run command:
python “C:\Program Files\KiCad\bin\scripting\plugins/” “C:\Users\MadTo\OneDrive\Email%20attachments\Documents\tskpcb\tskpcb\tskpcb.xml” “C:/Users/MadTo/OneDrive/Email%20attachments/Documents/tskpcb/tskpcb/tskpcb”

I found these files:


Your file tskpcb is csv file. You can just change its name.
The tskpcb.xml is the temporary file (to have a directory clear I delete it just after generating BOM).
I am keeping in my project directory only .kicad_pcb, .pro and .sch files.
When I was first time experimenting with BOM it was easy to notice which files are new.
I am deleting cache files on my own risk. You need not to follow my way.

See in my screen shoot - as I was writing previously I had changed (according to instruction in right window) in command line %O with %O.csv.
If you do the same you will get tskpcb with .csv extension.

One more info.
I’m not sure if it is still true !!
This way I got csv with wrongly sorted references even it looks that Python program tries to sort them.
I have modified that .py file to reach other task (working as blind as I don’t know Python - I wonted to eliminate from BOM elements that are not needed to be installed like pads for wires) and as the side effect I got them right sorted. Reading the source my program calls sorting twice (each time differently).
I reported it as a bug, and there were done some changes so .py files with 5.1.5 are different that those I had (small changes). If remember well (don’t sure) I have tried those time them also and got the same results - it looked like calling sorting one way worked and another way didn’t.
But I don’t care that computer losses some time on two times sorting. I get what I wont (as the side effect) and close that KiCad investigation step and went to next one.

OK, found the file, with your help. I opened it up in excel and changed some data and then loaded it into Access. (Just what I needed). I have more to learn for BOM and Plugins.
Thanks for your help! Now I want the Interactive BOM Plugin to work, doesn’t show?
I used xsltproc -o “%O” “C:\Program Files\KiCad\bin\scripting\plugins\bom_with_title_block_2_csv.xsl” “%I”

Interactive BOM doesn’t work like eeschema bom plugins. Follow instructions to get it installed and invoke it from pcbnew.

In this subject I can’t help. I didn’t tried and don’t plan to do it.
The key is word ‘Interactive’. I think that if each time I will generate BOM I will do it interactively than I suppose it rises the probability of mistake (if I well understood the ‘interactive’).
I prefer to have that proces to be done as needing not thinking during it.
My BOM generation is not fully automatic (so someone can say it is interactive) but during it I have no decisions to be done.

From my modified .py I get .csv containing only elements to be assembled.
I read it into spreadsheet in which the elements specifications are automatically supplemented (from the other (database) sheet in the same spreadsheet. Then I sort it (special field from database to help order elements in ‘my’ order).
Then I copy the result and paste it (as only text - breaking the connections to database) to the destination bom spreadsheet.
I work that way since 12…14 years. Practically, each time I am doing it I find that I had to add one or two elements to the database as when I was selecting them to use I forgot to do that.

Moving to KiCad I decided to complicate my spreadsheet a little more to break a rule that element symbol precisely identifies the element. Now I use symbol+footprint as identification.

Well it is not interactive in that way you just set it up and it generates the BOM as you want it. The “interactive” part comes when you “see” it, because you can zoom in and out from the board, or check where each part is on the board when clicking on its name.

I definitely will recommend you to take a look at it, it is quite nice and useful. (thanks @qu1ck!)

Have you seen one of the demos ? here is a link, that is what you get after you run it.


May be in some time, but I place it in my queue at the end - with small priority.
The key question is - what kind of problems it solves and how?
For me the bom subject is ticked off, and other not ticked are more important.

Now I got into and I am going down in FreeCAD :frowning:
When be back in KiCad I have also some subjects to learn. For example I didn’t checked yet how to route differential pair. Specially I wont to go with pair tracks through intermediate pads with result that track length have to be the same from begin to end ignoring the positions of intermediate pads.
If it will not work for me I will ask at forum - but not yet.

The Interactive BOM plugin is designed to make hand assembling (and inspection) easier. It is not really for building a purchase/pull list to gather parts (although it does have check boxes that can optionally be used to indicate which parts have been sourced). After running the script you get a local dynamic web page showing a list of the parts and board views. When you hover your pointer over a line in the parts list all the parts indicated by the line are highlighted on the board view (for example, hovering over the line that has all the 0.1uF caps will highlight all the 0.1uF caps on the board). It makes the game of “where are all my 1k0 resistors” easier. You can also click on a part on the board and that part’s line will get highlighted in the list as well as all the other parts of the same value will be highlighted.

If you never hand assemble boards, you probably won’t get much mileage from Interactive BOM. But if you do, it can be a powerful tool. Especially if you are working with a group of assemblers, you can give them the web file (or link if widely available) and they can view it on any browser without needing to have KiCAD installed on their device/computer.


30 years ago :slight_smile:
From time to time we assemble prototypes but it happens 240km from me.
But they use for it semi-automatic machine and as I can imagine it could be easier to use paper documentation then to turn continuously to look at monitor. The machine has no motor. It has a vacuum grab and the hand driven arm with position detectors.
They need not to place the same type elements one after another. I have never seen how they are doing it, but they probably place one element after another in some like Z shape order so by X-Y coordinates and not by values.
With next PCBs machine help/control you by rounding the wheel with elements that you see only the drawer with elements to take one of them and directs you to right position (up/down/left/right LEDs at the arm). It has enough time to round wheel during you place the previous element. So placing the same type elements one after another has very little advantage and only during machine learning stage.

we have such machine in use:
and we mainly use for dispensing soldering paste if there is no stencil or stencil is old version. Its not a replacement for pick & place machine but a comfortable and expensive replacement for tweezers. Efforts to automate (see LM901 model) seems expensive and useless. Required mechanics is always insufficient until you have a “real pnp” machine. Dispensing QFP is not working with the LM900/901 but placement of QFP is quite comfortable and accurate since there is not only xy movement but also exact rotation. For passive components we work most time without that gimmicks (using paper & pencil)

I found in internet the photo of the one like we use:
pobrany plik

We used it intensively from 1995 till 2005. Then we start to order assembled PCBs from contract manufacturer. Now we use it only to make prototypes - 2…3 times a year.

FYI - I recorded a video introduction on creating a BOM with KiCad 5.x. It is in part 24 of this playlist:

1 Like

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