Pinion icon indicating copy to clipboard operation
Pinion copied to clipboard

Crash with `pinion generate plotted `

Open Keuronde opened this issue 2 years ago • 1 comments

I just install the v3.0 and git it a try! I was able to generate the template, but not the output. I tried with two boards:

$ pinion generate plotted --board carte.kicad_pcb --specification carte_config.yml output
Traceback (most recent call last):
  File "/home/samuel/.local/bin/pinion", line 8, in <module>
    sys.exit(cli())
  File "/home/samuel/.local/lib/python3.9/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "/home/samuel/.local/lib/python3.9/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "/home/samuel/.local/lib/python3.9/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/samuel/.local/lib/python3.9/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/samuel/.local/lib/python3.9/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/samuel/.local/lib/python3.9/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/home/samuel/.local/lib/python3.9/site-packages/pinion/ui.py", line 72, in wrapper
    return func(*args, **kwargs)
  File "/home/samuel/.local/lib/python3.9/site-packages/pinion/ui.py", line 105, in generatePlotted
    generate(specification=yaml.load(specification),
  File "/home/samuel/.local/lib/python3.9/site-packages/pinion/generate.py", line 327, in generate
    fSource, bSource = imageGenerator(board, outputdir)
  File "/home/samuel/.local/lib/python3.9/site-packages/pinion/ui.py", line 98, in generateImages
    return generateDrawnImages(board, outputdir, dpi, {
  File "/home/samuel/.local/lib/python3.9/site-packages/pinion/generate.py", line 261, in generateDrawnImages
    fSource = generateImage(board.GetFileName(), outputdir / "front.png",
  File "/home/samuel/.local/lib/python3.9/site-packages/pinion/generate.py", line 192, in generateImage
    image = plotter.plot()
  File "/home/samuel/.local/lib/python3.9/site-packages/pcbdraw/plot.py", line 1051, in plot
    self._build_libs_path()
  File "/home/samuel/.local/lib/python3.9/site-packages/pcbdraw/plot.py", line 1156, in _build_libs_path
    for l in self.libs:
TypeError: 'NoneType' object is not iterable

For more information, I played a bit with the version of the package previously, I don't know if it is related...

$ pip show pinion
Name: Pinion
Version: 0.3.0
Summary: Create interactive pinout diagrams for KiCAD PCBs
Home-page: https://github.com/yaqwsx/Pinion
Author: Jan Mrázek
Author-email: [email protected]
License: UNKNOWN
Location: /home/samuel/.local/lib/python3.9/site-packages
Requires: pcbdraw, pcbnewTransition, ruamel.yaml, click
Required-by: 
$ pip show pcbdraw
Name: PcbDraw
Version: 1.1.1
Summary: Utility to produce nice looking drawings of KiCAD boards
Home-page: https://github.com/yaqwsx/PcbDraw
Author: Jan Mrázek
Author-email: [email protected]
License: UNKNOWN
Location: /home/samuel/.local/lib/python3.9/site-packages
Requires: Pillow, pybars3, lxml, click, svgpathtools, pyyaml, numpy, pcbnewTransition, pyVirtualDisplay, mistune
Required-by: Pinion

I am available if you need more info !

Keuronde avatar Feb 03 '23 21:02 Keuronde

(Edited: tabs dissapeared after pressing send, careful with that) I had the same issue, fixed it by modifying the generate.py file, added: if pcbdrawArgs['libs'] is None: pcbdrawArgs['libs'] = ["KiCAD-base"] under: def generateDrawnImages(board: pcbnew.BOARD, outputdir: Path, dpi: int, pcbdrawArgs: any)
-> Tuple[Dict[str, Tuple[int, int]]]:

But now I have another error: via_type = pcbnew.VIA if LEGACY_KICAD else pcbnew.PCB_VIA ^^^^^^^^^^ AttributeError: module 'pcbnewTransition.pcbnew' has no attribute 'VIA'

Maybe there is a problem with the versions?? I have the feeling that if I fix this one, another one will pop out...

FailSafinho avatar Jun 14 '24 10:06 FailSafinho