`ModuleNotFoundError: No module named 'kicad_netlist_reader`

After upgrading to KiCAD 7.0 I am unable to create a BOM. There error I get:

ModuleNotFoundError: No module named 'kicad_netlist_reader

My OS is Ubuntu 22.04 jammy. I used Discover to install this KiCAD as a flatpak, and in Discover I also installed all displayed KiCAD plugin options. Non that Discover offered involved BOM.

I did a system wide search for the file “kicad_netlist_reader.py”. This is the result:

stephen@stephen:~$ sudo find / -iname kicad_netlist_reader.py
/home/stephen/.local/share/flatpak/app/org.kicad.KiCad/x86_64/stable/69c565c1260faec38cfc5f6674e37cc8e1e4e19520a793923df130e42ef1ce67/files/share/kicad/plugins/kicad_netlist_reader.py
stephen@stephen:~$

So I do have this file in my system, but not in the right place. Please provide me a procedure to get this file installed in the correct place. In which directory does this file need to be?

How are you generating the BOM? Are you using the BOM window in the schematic editor, or do you have a custom script you are using in your terminal?

A flatpak is sandboxed from the host system. This means that all the contents which come with it are not directly available from your normal host terminal.

From what you wrote I guess that you have a custom script somewhere that you try to run in a terminal.

Depending on your actual script, it might be possible to open a shell inside the flatpak via flatpak run --command=sh org.kicad.KiCad, and then run your custom script from there. Note though, that you will also have to specify the path to the module via PYTHONPATH or similar or it will also not be found, as can be seen in the following quick test:

$ flatpak run --command=sh org.kicad.KiCad
[📦 org.kicad.KiCad ~]$ python -c 'import kicad_netlist_reader'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'kicad_netlist_reader'
[📦 org.kicad.KiCad ~]$ PYTHONPATH=/app/share/kicad/plugins python -c 'import kicad_netlist_reader'
[📦 org.kicad.KiCad ~]$
1 Like

I had the same problem after a complete reinstall of my system. I found an obscure instruction to use python3 instead of python to invoke the script. I made that change in the “Bill of Material” popup and it worked.
Example:

python3 "/usr/share/kicad/plugins/Mouser.py" "%I" "%O.Mouser.csv"

Depending on the distro, python could be a link to python2 or python3. It’s best to be explicit and spedify python3.

1 Like

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