Windows - Customizing Symbol Library Path - Damn the "\"

This problem kicked my butt for hours so I thought I’d highlight this easy to miss mistake.

Yes, I know there are tons of threads on customizing Library Paths but most focus on Footprint libraries. I read and re-read them all and just got more and more confused when all I wanted to do was customize the Symbol Library path.

When it comes to the Symbol Library one must edit the “kicad.pro” file located in the

C:\Program Files\KiCad\share\kicad\template

directory in Windows. In my case I wanted it to point to a local copy of the github repository of symbols I downloaded which was located at:

C:\Users\<myuserid>\Documents\git\kicad-library\library

So I just cut-and pasted that path from Windows into the appropriate section of “kicad.pro” as described in some of the threads. (See below)

[eeschema]
version=1
LibDir=C:\Users\<myuserid>\Documents\git\kicad-library\library
[eeschema/libraries]
LibName1=power

Unfortunately, that doesn’t work due to the subtile issue that is REALLY easy to miss if your not careful.

Kicad is written in Python which expects Unix “/” style directory paths. The correct format should have been:

[eeschema]
version=1
LibDir=C:/Users/<myuserid>/Documents/git/kicad-library/library
[eeschema/libraries]
LibName1=power

This kicked my butt for hours trying to figure what was wrong as I didn’t notice the “/” versus “\” in the path. Once I changed all the “” to “/” it started working.

Now every time I create a new project, that path is included in the Project’s “.pro” file and I can use the latest version of the symbols (plus a few others I’ve added.)

Again, I know there are a lot of discussions on Library Paths on the Forum but I wanted to specifically make a post on this issue so others would not have the same problem I had.

1 Like

Kicad is not written in Python, but C++. Sorry you had so much trouble, but the preferred way to add and remove symbol libraries is, in Eeschema, select Preferences -> Component Libraries, then select Add, which pulls up a dialog you should be familiar with in Windows.

1 Like

But that requires the path to be added every time I create a new project (unless I’ve missed something). I want it to default to the correct path for symbols for every new project.

As to Python vs. C++, I thought I saw a discussion on the forum that said it was written in Python. OK. Either way, this is one of the subtle differences that is easily missed when setting up KiCad paths in a Windows environment.

I looked at the path over and over and didn’t notice the usage of the wrong “slash”.

If you’re on Windows, open C:\Programs\Kicad\share/kicad/template/kicad.pro and set up your libraries, now every time you create a new project, it’ll be set up right. I use it to grab a page layout as well as company symbols and it works great. If you reinstall Kicad, this will get overwritten.

Yes, this is exactly what I did. My point was that I kept missing that the LibDir values in kicad.pro used the wrong “slash” character and KiCad just quietly ignored the LibDir specification. When I switched to the Unix style slash characters, it began to work.

The purpose of my post was to make this simple mistake well know to other newbies like myself. It’s easy to not notice the wrong slash. Especially if you are like me and did a “cut-and-paste” from Windows into kicad.pro.

2 Likes

BTW, I’m just coming back to KiCad after not doing any PCB work for some time. The new 4.0 release is a nice improvement to the previous version I used. Kudo’s to the development team. I’m looking forward to future features and tools from them.