How to solve “Building wheel for chroma-hnswlib” error on AWS Lambda ?
I was writing ‘Part 3: Lambda Implementation’ for this article series, and I was attempting to install ‘chromadb’ to be executed within the Lambda.:

and I encountered the below error:

Based on the error, it’s evident that the issue was related to the ‘chromadb’ dependency. By the way, this was my dependency stack:

When I started searching for a solution to this error I fell into a rabbit hole of web links suggesting solutions for windows and macos, even there is this one by chromadb that suggests some solutions:

I tried all of the above and more such solutions, even switched to a Windows and a Linux machine, blaming mac M1 for the root of the problem, but interestingly I encountered the exact same error on all the machines, and none of the solutions worked.
It took me some tries and failures, post which I realized that none of the solutions will work, since I was doing it in a docker file, and host OS doesn’t matter since execution is happening inside the docker image🤦
After a few more tries I encountered this and this, which required me to use the below command :

And this finally fixed the error!
Lesson learned from this experience ?
When encountering an error in an unknown domain, do not blindly try to copy and paste solutions. Sometimes, it’s a good idea to take a step back and think through the problem.
PS: For anyone facing this issue this is the Docker File I used.
🌟 Stay Connected! 🌟
I love sharing ideas and stories here, but the conversation doesn’t have to end when the last paragraph does. Let’s keep it going!
🔹 LinkedIn for professional insights and networking: https://www.linkedin.com/in/madhav-arora-0730a718/
🔹 Twitter for daily thoughts and interactions:https://twitter.com/MadhavAror
🔹 YouTube for engaging videos and deeper dives into topics: https://www.youtube.com/@aidiscoverylab
Got questions or want to say hello? Feel free to reach out to me at [email protected]. I’m always open to discussions, opportunities, or just a friendly chat. Let’s make the digital world a little more connected!






