About the only way to manage such a disaster that does not involve plentiful conquest is to beeline megastructures, and trying to secure a black hole for the matter decompressor. The only real shortage you'll have in this case is minerals - food can be fixed with agri-habitats, energy is never an issue with sufficient trade, neither are consumer goods. So the focus, then, becomes obtaining the most efficient way to generate alloys from as few minerals as possible - this means an off-capital ecumenopolis forge world, probably fed by market purchases made from energy excess/food excess, and running a militarized economy.
Edit: this is assuming you're surrounded by a galaxy full of hostiles who don't want to trade with you at all. Direct resource trades with other empires will probably be more efficient than using the market, if for no other reason than bypassing the market fee.
With that said - if you happen to end up in that situation in an actually competitive scenario (say, vs AI that doesn't suck or vs actual players), your only recourse is early war, while the lack of resource districts isn't yet limiting your capacity to build and maintain a fleet relative to your neighbors. This, incidentally, is also the overall optimal way to solve the issue.