devbisme / skidl

SKiDL is a module that extends Python with the ability to design electronic circuits.
https://devbisme.github.io/skidl/
MIT License
1.04k stars 118 forks source link

skidl unable to open KiCAD symbol library #154

Closed Timot05 closed 2 years ago

Timot05 commented 2 years ago

I'm trying to run the example code provided in the introduction: here.

I get the following error:

WARNING: Could not load KiCad schematic library "device", falling back to backup library. @ [/Users/me/Dev/folder/example.py:14]
Traceback (most recent call last):
  File "/Users/me/Dev/folder/example.py", line 14, in <module>
    r1, r2 = 2 * Part ('device', 'R', TEMPLATE) # Create two resistors.
  File "/opt/homebrew/lib/python3.9/site-packages/skidl/part.py", line 189, in __init__
    raise e
  File "/opt/homebrew/lib/python3.9/site-packages/skidl/part.py", line 179, in __init__
    lib = SchLib(filename=libname, tool=tool)
  File "/opt/homebrew/lib/python3.9/site-packages/skidl/schlib.py", line 84, in __init__
    load_func(
  File "/opt/homebrew/lib/python3.9/site-packages/skidl/tools/kicad/kicad.py", line 67, in load_sch_lib
    raise FileNotFoundError(
FileNotFoundError: Unable to open KiCad Schematic Library File device

I installed KiCAD6 and installed the latest version of skidl on macOS.

I set my environment variable like so: export KICAD_SYMBOL_DIR="/Applications/KiCad/KiCad.app/Contents/SharedSupport/symbols/"

Thanks for the support!

Timot05 commented 2 years ago

Make sure you have "device" symbol in your library. In my case, it wasn't there. Fixed now!