Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does not work in Kicad 6 #14

Open
haakonnessjoen opened this issue Oct 10, 2022 · 4 comments
Open

Does not work in Kicad 6 #14

haakonnessjoen opened this issue Oct 10, 2022 · 4 comments

Comments

@haakonnessjoen
Copy link

I get the following error:
ModuleNotFoundError: No module named 'kicad_netlist_reader'

@ciaagent
Copy link

ciaagent commented Nov 23, 2022

Same.

python3 "C:\Users\xx\Documents\KiCad\6.0\scripting\plugins/bom_csv_jlcpcb.py" "D:\Data\Projects\KiCad\ESP32 PC Front Panel\ESP32 PC Front Panel.xml" "D:/Data/Projects/KiCad/ESP32 PC Front Panel/ESP32 PC Front Panel.csv" Command error. Return code 1. Traceback (most recent call last): File "C:\Users\xx\Documents\KiCad\6.0\scripting\plugins\bom_csv_jlcpcb.py", line 23, in <module> import kicad_netlist_reader ModuleNotFoundError: No module named 'kicad_netlist_reader'

@ForrestErickson
Copy link

I also have the error ModuleNotFoundError: No module named 'kicad_netlist_reader' when running the bom_csv_jlcpcb.

Full error:

python "C:\Users\Public\Downloads\programs\KiCad_JLCPCBPlugIn\kicad-jlcpcb-bom-plugin/bom_csv_jlcpcb.py" "C:\Users\Public\Downloads\Arduino\PubInv\general-alarm-device\Hardware\PolyVent_SPI_Controller\PolyVent_SPI_Controller.xml" "C:/Users/Public/Downloads/Arduino/PubInv/general-alarm-device/Hardware/PolyVent_SPI_Controller/PolyVent_SPI_Controller.csv"
Command error. Return code 1.
Traceback (most recent call last):
File "C:\Users\Public\Downloads\programs\KiCad_JLCPCBPlugIn\kicad-jlcpcb-bom-plugin\bom_csv_jlcpcb.py", line 23, in
import kicad_netlist_reader
ModuleNotFoundError: No module named 'kicad_netlist_reader'

I am running Windows 10.
I am running this version of KiCad 6.0.6
image

I would suspect the root cause is that we need a module 'kicad_netlist_reader'
But from where would this come?

@ForrestErickson
Copy link

ForrestErickson commented Nov 28, 2022

More information.
I found the 'kicad_netlist_reader' in my KiCad folder ...KiCad\6.0\bin\scripting\plugins .
See screen shot:
image

I moved my Wikwi python scripts into this folder and had to press the button regarding administrative privileges.
I reran the script and now get a new error.

python "C:\Program Files\KiCad\6.0\bin\scripting\plugins/bom_csv_jlcpcb.py" "C:\Users\Public\Downloads\Arduino\PubInv\general-alarm-device\Hardware\PolyVent_SPI_Controller\PolyVent_SPI_Controller.xml" "C:/Users/Public/Downloads/Arduino/PubInv/general-alarm-device/Hardware/PolyVent_SPI_Controller/PolyVent_SPI_Controller.csv"
Command error. Return code 1.
Traceback (most recent call last):
File "C:\Program Files\KiCad\6.0\bin\scripting\plugins\bom_csv_jlcpcb.py", line 48, in
out.writerow([c.getValue() + " " + c.getDescription(), ",".join(refs), c.getFootprint().split(':')[1],
IndexError: list index out of range

The indexError:list index out of range requires the next investigation.

Continued...
I found that the script did make a file and it has some but not all rows necessary to cover all my component types as a BOM should. I expect 29 rows based on the BOM I get from the KiCad bom scripts that do work.

Something caused the index out of range error.
image

Of course the column "LCSC Part #" is empty because I do not have such a field in my parts (yet).

Another root cause of this not working is that the required Symbol Properties fields required were not defined byt this project. The requirements could be put for example in the README.md of this project.

@carlsa
Copy link

carlsa commented Feb 8, 2023

I had the same issue on Linux with KiCad 6 installed as a flatpak.

I solved it by adding the KiCad system installation plugin folder to the python path by adding this in the top of bom_csv_jlcpcb.py.

import sys
sys.path.append('/usr/share/kicad/plugins')

I guess one could also solve it by placing the script in /usr/share/kicad/plugins

Thank you for creating the project @urish 🙂

KiCad 7 flatpak update
For the KiCad 7 Flatpak distribution I added this to the top of the script:

import sys
sys.path.append('/app/share/kicad/plugins')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants