I don’t use Spyder but that shouldn’t matter if you’re running python from a .pbix file. Is this what you’re doing?
PowerBI runs python by default from your local python install. If you’re running a virtual environment - make sure you reconfigure by going to options and settings