Problems compiling kicad-python in windows

Hello all,

I have been having some trouble compiling the repository. I have followed the instrunctions in COMILING.md but I cant get rid of this error https://forum.kicad.info/t/kicad-9-0-python-api-ipc-api/57236/45. I am running windows 10 and this is the procedure I followed:

  1. Installed protobuf and made sure it was callable
winget install protobuf
  1. Followed the steps in the instructions without any error (tested with both python and python3)
$ python3 -m venv .env
$ . .env/bin/activate
$ python3 -m pip install --upgrade pip
$ python3 -m pip install poetry pre-commit
$ poetry install
$ poetry env activate 
$ poetry build
$ pip install -e .

But I keep getting the error

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "D:\Escritorio\PIK\kicad-python\kipy\__init__.py", line 21, in <module>
    from kipy.kicad import KiCad
  File "D:\Escritorio\PIK\kicad-python\kipy\kicad.py", line 31, in <module>
    from kipy.board import Board
  File "D:\Escritorio\PIK\kicad-python\kipy\board.py", line 25, in <module>
    from kipy.board_types import (
  File "D:\Escritorio\PIK\kicad-python\kipy\board_types.py", line 26, in <module>
    from kipy.proto.common.types import KIID
  File "D:\Escritorio\PIK\kicad-python\kipy\proto\common\__init__.py", line 23, in <module>
    from .envelope_pb2 import *
ModuleNotFoundError: No module named 'kipy.proto.common.envelope_pb2'

I have added the recursive repo dependencies as stated.

Any guess? Thanks!

Yea so protobuf is not the nicest for API stability within it’s own domain of tools (the protocol itself is different)

Kicad is currently built on Windows with protobuf 3.21.12
to be compatible with kicad-python’s pip requirements declared version of protobuf tooling. You will most likely need the same 3.21.x version.

Though I may be remembering it slightly wrong for kicad-python. Main point is kicad-python’s has pip requirements.txt. it pins a specific version of the protobuf python library. That library is only compatible with certain protobuf compiler versions.

Did it actually generate the files? You should see various generated py and pyi files in the tree ./kipy/proto if the build step worked correctly.

While this is true, the error doesn’t look like one related to having the wrong version.

I have just checked and you are right, the files are not generated inside the directory (only the init files). I will check all the package versions.

Thanks!

Did you get any error messages when running poetry build?

No, the building process ended without any error or warnings but its true that there is not much going on… I have repeated the process (from scratch) in case it gives you some additional information

(.env) PS D:\Escritorio\PIK\kicad-python> poetry install
Installing dependencies from lock file

Package operations: 43 installs, 1 update, 0 removals

  - Installing markupsafe (3.0.2)
  - Installing alabaster (0.7.16)
  - Installing babel (2.17.0)
  - Installing docutils (0.21.2)
  - Installing imagesize (1.4.1)
  - Installing jinja2 (3.1.6)
  - Installing pygments (2.19.1)
  - Installing snowballstemmer (3.0.1)
  - Installing sphinxcontrib-applehelp (2.0.0)
  - Installing sphinxcontrib-devhelp (2.0.0)
  - Installing sphinxcontrib-htmlhelp (2.1.0)
  - Installing sphinxcontrib-jsmath (1.0.1)
  - Installing sphinxcontrib-qthelp (2.0.0)
  - Installing sphinxcontrib-serializinghtml (2.0.0)
  - Downgrading pbs-installer (2025.6.10 -> 2025.6.6)
  - Installing pycparser (2.22)
  - Installing soupsieve (2.7)
  - Installing sphinx (7.4.0)
  - Installing argcomplete (3.6.2)
  - Installing attrs (25.3.0)
  - Installing beautifulsoup4 (4.13.4)
  - Installing cffi (1.17.1)
  - Installing click (8.1.8)
  - Installing colorlog (6.9.0)
  - Installing dependency-groups (1.3.1)
  - Installing iniconfig (2.1.0)
  - Installing mypy-extensions (1.1.0)
  - Installing pathspec (0.12.1)
  - Installing pluggy (1.6.0)
  - Installing protobuf (5.29.5)
  - Installing sphinx-basic-ng (1.0.0b2)
  - Installing types-protobuf (6.30.2.20250516)
  - Installing wrapt (1.17.2)
  - Installing deprecated (1.2.18)
  - Installing furo (2024.8.6)
  - Installing mypy (1.16.0)
  - Installing mypy-protobuf (3.6.0)
  - Installing nox (2025.5.1)
  - Installing poetry-plugin-export (1.9.0)
  - Installing protoletariat (3.3.10)
  - Installing pynng (0.8.1)
  - Installing pytest (8.4.0)
  - Installing ruff (0.9.10)
  - Installing setuptools (75.9.1)

Installing the current project: kicad-python (0.4.0.dev0)A setup.py file already exists. Using it.
Installing the current project: kicad-python (0.4.0.dev0)
(.env) PS D:\Escritorio\PIK\kicad-python> poetry env activate
& "D:\Escritorio\PCB_SPIRAL\spiral_array\scripts\.env\Scripts\activate.ps1"
(.env) PS D:\Escritorio\PIK\kicad-python> poetry build
Building kicad-python (0.4.0.dev0)
Building sdist
Building wheel

Thanks!