I ran into this exact error - turns out the problem is you need to update the Marlin source code. Doing a git pull on the branch to get the latest fixed the problem, reinstalling platformio did not. The problem is your platformio has updated at some point, but the Marlin code is using an older API.
It seems that the platformio.managers.package was removed - or at least trying to do import platformio works, import platformio.managers works, and import platformio.managers.package gives the error.