Footprint editor: environment variables expansion failed

I am running through the Getting Started in KiCad, Using Footprint Editor page 42, step 2. I must have typed an extra { in the Footprint Libraries Manager and am now stuck in a continuous loop of error messages within the Footprint editor. I am running KiCad version 4.0.2+e4-6225~38~ubuntu14.04.1-stable,release build. I have looked everywhere I can think of to locate the file that has the extra { to edit but have been unable to find it. The continuous error message that the footprint editor is displaying is:

10:44:40 AM: Environment variables expansion failed: missing ‘}’ at position 3 in ‘${{KIPRJMOD}/
myfootprint.pretty’.

When I click on OK the message pops back up such that I can’t close the Footprint editor. I would appreciate any help with this situation?

Assuming that you are using KIPRJMOD variable the invalid entry could reside in project specific library table. Open your project folder and check if fp-lib-table file was created. If yes, open it with plain text editor and try to find doubled {.

If you don’t find any wrong entry in local fp-lib-table try to locate global fp-lib-table file in your home directory and check as above. The file should be in ~/.config/kicad/. BTW: Using KIPRJMOD variable in global library table is a bad idea and the greatest sin against KiCad. :skull_crossbones:

1 Like

I am wondering, if using KIPRJMOD variable is a bad idea, why is it specified in the Getting Started in KiCad document, Section 8.1 Using the Footprint Editor, Step 2?

Thank you for your help. I found the global fp-lib-table and fixed my problem.

Maybe because KIPRJMOD stands for KiCAD Project Modules (=footprints) where as the global variable that should be used is KISYSMOD.
And looking into my global fp-lib-table I can only find KISYSMOD.

KIPRJMOD always point to the current project folder. So using it in global table is pointless and in some cases could be a source of invalid path problems (for ex. when you start Pcbnew without any project). This variable is commonly used in local table where is more useful.

There is one possibility to use this variable in the global table. When you prepare your own complete project template and some selected, and permanent libraries will be copied too when you start new project based on this template. And you always begin any project that way. However, IMO this is the solution that should not be used.

Summarizing:

  1. Use KIPRJMOD in local footprint library table only and for project specific footprint libraries from project folder. This way when you move your project every local fp library will be visible by KiCad library system.
  2. Use KISYSMOD in any footprint library table when you need KiCad libraries saved to a local disk. This variable can be overriden, but I suggest to hold its default value: the path to KiCad stock libraries (if installed or downloaded).
  3. Use KIGITHUB in any footprint library table when you need KiCad libraries from offical GitHub repository and have stable and quite fast internet connection.
  4. Create your own variable, for ex. MYSYSMOD and use it in any footprint library table when you have your own libraries stored elsewhere on local disk (outside KiCad share “ecosystem”). You can create more variables, to point to different directories.
  5. Create your own variable, for ex. MYGITHUB and use it in any footprint library table when you have your own libraries stored in your own GitHub repository. For example: https://github.com/sth303/myfootprints.pretty