Error: PythonPipBuilder:None - Binary validation failed! Error on MacOS
See original GitHub issue**Build Fails when you try to build serverless application **
When I try to build my serverless application, it fails with the error:
Error: PythonPipBuilder:None - Binary validation failed!
This happens with both my conda environment and my virtualenv environment.
When I try to use sam build in commandline, it fails with the same error when I am not in my designated conda environment but it works perfectly fine when I am in the designated conda env. For virtual env it works perfectly when I am in commandline.
To reproduce
- Create a new project with Hello World Sam template
- Right click on the template file and select "Deploy Serverless Application.
- Select relevant bucket and add the name and click “deploy”.
Expected behavior I expect this to deploy the application.
Screenshots

Your Environment
- OS: macOS 10.14.3
- JetBrains’ Product: PyCharm
- JetBrains’ Product Version: 2018.3
- Toolkit Version: 1.1
- SAM CLI Version: 0.12.0
- JVM/Python Version: 3.6
Issue Analytics
- State:
- Created 5 years ago
- Comments:14 (3 by maintainers)
Top Results From Across the Web
How to export PATH to "sam build" command? - Stack Overflow
Error : PythonPipBuilder:Validation - Binary validation failed for python, searched for python in following locations : ['C:\\Python310'] ...
Read more >Using AWS SAM default template in PyCharm: Python Version ...
Error : PythonPipBuilder:Validation – Binary validation failed for python, searched for python in following locations : ['/usr/bin/python', ...
Read more >Library Validation failed: reason:… | Apple Developer Forums
Library Validation failed: reason: mapping process is a platform binary, but mapped file is not.
Read more >Changelog — Python 3.11.1 documentation
gh-99181: Fix failure in except* with unhashable exceptions. ... copies of the python binary when the base installation does not provide the executable...
Read more >Docker - Could not find python3 image locally and failed to ...
Describe your question in as much detail as possible: In my AWS SAM build-and-package step, the docker container fails to pull an image...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Using option
-u, --use-containercan resolve the runtime inconsistent issue.https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-cli-command-reference-sam-build.html
I had this same problem yesterday. In my case, I had Python 3.7 installed as my main Python (also on macOS). I was able to reproduce the problem outside of PyCharm, just by doing
sam buildat a command line. That led me to learning there is a--debugcommand line option which eventually led me to discover that I had to install Python 3.6, because SAM doesn’t support 3.7.I tell you my story in hopes maybe it will help you get to the root of your problem, even though you said you’re using 3.6. In other words, try it from a command line and see if you can take aws-toolkit-jetbrains out of the equation.