difficulty with "pip install klayout"

I have copied klayout-bits-1.0 to my computer and installed Microsoft Visual C++ build tools 2017. I set the path to include all the links within the klayout-bits directory as shown below. However when I try to run "pip install klayout" (windows, python 3.11 or 3.12) I run into the error that zlib.h is missing. It seems my path is not picking up the klayout-bits files. Here is the latter part of my path:


Any ideas what I have missed? I have previously installed the python package successfully, and I can't figure out what I might have done differently.



  • I managed to resolve this issue. I'm not sure exactly what the problem was, but I did un-install and re-install Microsoft Visual Studio 2017 (twice, actually), then everything worked again.

  • You should not need to build Windows versions. There is a wheel available for Python 3.11 and 3.12 for klayout 0.28.17 based on Visual C++ 2017.

    How come you need to build from source?


  • I don't know, it was strange. It did not find the wheel but instead tried to build itself. I just tried uninstalling and re-installing through pip and it does find the wheel now.

  • @mjcich Thanks for the feedback.

    PyPI has a strange policy of "all or nothing", so while the packages are built by the GitHub actions, parts may be available already while others are not. In addition, things are constantly changing and sometimes deployment fails. In that case I need to re-trigger a complete build and a new version is created.

    Maybe you tried to install during such a phase. In that case you can try installing a specific, previous version which comes with binary support for you platform.


Sign In or Register to comment.