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

Crash with pinion generate plotted #35

Open
Keuronde opened this issue Feb 3, 2023 · 1 comment · May be fixed by #36
Open

Crash with pinion generate plotted #35

Keuronde opened this issue Feb 3, 2023 · 1 comment · May be fixed by #36

Comments

@Keuronde
Copy link

Keuronde commented Feb 3, 2023

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 !

@FailSafinho
Copy link

FailSafinho commented Jun 14, 2024

(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...

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

Successfully merging a pull request may close this issue.

2 participants