Worked in that environment for 5 years... I honestly never found a way. Now work mostly remotely.
I feel like I tried everything - headphones, locking myself in meeting rooms, being uninviting when people interrupted.
I wish I could tell you a story about how I figured it out but now I only take jobs that are at least semi-remote. I would consider a job where there are real offices for everyone but this seems to be increasingly difficult to find.
I'd talk to your boss about working remote 2-3 days a week and proving how much more productive you are during those days.
Yeah I ended up talking to management and arranged to work from home a few days a week, mostly coming in on meeting days or team stuff. I asked them for a trial initially, and when they saw how productive I was when I wasn't in, they were instantly sold on it.