First world Python environment problem
TD;LR: Migrating an Intel Mac to one with an M chip messes up the Python environments
I haven’t been writing much lately. I’ve convinced myself it’s nothing to do with my own motivation, but because my 2018 Macbook was so painful to use. It geniunely took 10 minutes before the cursor wouldn’t act drunk.
Your Macbook is so old that it still has Intel inside
I decided to upgrade to the M4 Air with 256Gb storage, placing my order on Feb 17th. Obviously I don’t pay attention to Apple’s release cycle, because less than 2 weeks later they announced the M5 Air with a minimum storage of 512Gb and the new M5 chip…ffs
Thankfully, Apple anticipated my annoyance and automatically upgraded me - turns out its quite a common thing. It probably makes perfect sense from their side (handling costs of returns, factory production rates etc) but it just gives you the same warm feeling as when Flat Iron gives you a free icecream.
After transferring my data to the new Mac I ran into an interesting problem
ImportError:
dlopen(.venv/lib/python3.9/site-packages/rpds/rpds.cpython-39-darwin.so, 0x0002):
tried: '.venv/lib/python3.9/site-packages/rpds/rpds.cpython-39-darwin.so'
mach-o file, but is an incompatible architecture
have 'x86_64', need 'arm64e' or 'arm64e.v1' or 'arm64' or 'arm64'
My old environment had x86-compiled Python packages, which don’t work when loaded by a native arm Python interpreter. The fix was simple enough, I ended up having to reinstall uv so that it would build environments with the new arm architecture. I just thought it was a fun issue everyone solved years ago.