MacOS KiCad - Footprint Library Loader Error: Environment Variable Expansion Issue Due to Trailing Space

Hello everyone,

I’m using KiCad on MacOS and encountering an issue. When I first open KiCad and try to change the footprint of any symbol in the schematic, I get this error:

Environment variables expansion failed: missing ‘}’ at position 18 in ‘${KICAD_3RD_PARTY }’. Environment variables expansion failed: missing ‘}’ at position 18 in ‘${KICAD_3RD_PARTY }’.

I suspect the problem might be due to the space before the ‘}’. However, I haven’t been able to determine the exact cause. I’ve tried deleting all the plugins related to libraries from KiCad, but the issue persists. I also opened the “./fp-lib-table” files with VSCode and checked the code lines but couldn’t find the problematic line mentioned in the error.

Has anyone experienced this issue and can explain how they resolved it?

Looks like one of your footprints has the extra space in the 3D model field.

thats the neat part, I have deleted all the 3rd party library folder paths from footprint libraries path but the error still persists. :smiley:

Since you’re on a Unixy system, try in a shell window:

cd where_your_footprint_libraries_are_kept
find . -name '*.kicad_mod' -print0 | xargs -0 grep 'KICAD_3RD_PARTY }'

Don’t know if Mac’s find supports the -print0 option, or if the xargs supports the -0 option. (That’s a zero, not capital O.)

I have done manually that what this code does. I have looked every one of the 3rd party libraries which is left on the folders and ends with “.kicad_mod”. Opened them on texteditor to see any lines contains “KICAD_3RD_PARTY }”. However, every one of them only contains coordinates and names. Nothing related to path. This didn’t worked.

I take it you’ve already checked the footprint library table?

What about project local libraries? Also check if there are any libraries that you may have installed in KiCad’s suggested directory which nearly everybody ignores: ~/.local/share/kicad/8.0/symbols on Linux, don’t know where on Mac.

Also delete fp-info-cache in the project directory in case it contains cached footprints.

I have checked the following path: “/Users/user1/Documents/KiCad/8.0/symbols” file was empty along with footprint file. Also went for the previous path and located “3rdparty” file, below that file I have cleaned the footprints and symbols files. Nothing changed, same errors. Deleting “fp-info-cache” didn’t fix the problem too. :confused: