Fixing the Pants Python 3.9 vs. 3.11 Mismatch
Photo by Mitchell Luo on Unsplash

Not a Medium Member? Read here.

Last night, I was working on a service and was bumping one of my library on a new Mac.

And, I found myself trapped in a loop of HTTP 404 errors of Pants that felt like digital middle fingers from the universe :)

This is the story/fix of how a simple Python version mismatch turned into a sleepless night — and the lessons I learned about trusting tools, questioning defaults, and why sometimes, you just need to burn the cache to the ground and update stuff.

Chapter 1: The Setup

It started innocently enough. I’d just finished rebuilding my development environment on my new M1 MacBook. Python 3.11? Check. Fresh Homebrew install? Check.

Now, I had already installed Pants some days back. So, I was sure I’ll have Pants up and running in 10 minutes, copying the installation command from their docs.

curl -L -O https://pantsbuild.github.io/setup/pants && 
chmod +x pants && ./pants

*Cue the ominous music.*

The first warning sign wasn’t even an error — just a weird message about downloading a “PEX” file for Python 3.9.

I might have paused. “But I’m on 3.11”. My cursor hovered over the Enter key. I pressed it anyway.

ERROR: HTTP 404. File not found: 
pants-2.25.0-cp39-cp39-macosx_11_0_arm64.pex

And so it began.

Chapter 2: The Descent Into Madness

For hours, I:

1. Reinstalled Python (twice) 
2. Brew uninstall/brew install’d until Homebrew side-eyed me 
3. Googled “HTTP 404 pants-build issues” until my search history looked like a cry for help

I even asked ChatGPT And DeepSeek. But Naaaaah!

Then came the breakthrough.

Well.

“CP39” — that’s obviously Python 3.9. But my system default was 3.11. Why was Pants looking for Older Python? And I spent a lot of time there too.

That’s when I discovered the villain of our story: scie-pants, the launcher binary. This little shit was earlier hardcoded to fetch Python 3.9 builds, like a stubborn toddler insisting carrots are poison. My modern Python 3.11 setup might as well have been invisible.

Chapter 3: The Fix

The solution came in three acts:

Bring in the latest cavalry

curl -LO https://github.com/pantsbuild/scie-pants/releases/latest/
download/scie-pants-macos-x86_64

chmod +x scie-pants-macos-x86_64 # Give it permission to exist

sudo mv scie-pants-macos-x86_64 /usr/local/bin/pants # Put it in VIP lounge

Apple Silicon warriors (like me) swap `x86_64` for `aarch64`

Carry a Big TOML Stick

I updated my `pants.toml` to lay down the law:

```
[python]
interpreter_constraints = ["==3.11.*"]
`
``

And then the Great Cleansing

Caches are like that junk drawer everyone has — sometimes you need to dump it all out:

rm -rf ~/.cache/pants ~/.cache/pex ~/.pants.d

And then the moment of truth:

pants - version

When “2.25.0” appeared without a 404, I nearly cried. The `cp311` PEX file downloaded like it was born to do this.

Now if you’ll excuse me, I need to go explain to my imaginary girlfriend why I was shouting at a laptop at 3 a.m.

Have you read — How A Single Line Of Python Code Broke Production ?

In case we are meeting for the first time, come over here, it’ll be worth the roller coaster of articles that are gonna come up in the next few weeks.

Use this to get to know more about me — https://linktr.ee/shashwat_writes