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.