Humans are pack creatures. If you put us in solitary confinement we go insane. This is generally true even for introverted people; only on the far edge of the bell curve do you find people who crave absolute solitude for weeks or months on end (and these people tend to be really odd, and it's often hard to tell if the oddness is cause or effect.)
However, as every reader of programming productivity books knows, being surrounded by a bunch of people that is constantly interrupting you makes it hard to focus. And so civic design has evolved the library, the coffeeshop, and the coworking space: Places where you can be alone yet also surrounded by people.
The secret is to surround yourself with people who don't have the same agenda as you. Then you won't often be interrupted by things that break your focus: The staff might occasionally ask to refill your coffee, and you'll get interrupted if the building catches fire, but otherwise you can work on your own thing.