I meant logging into the play store from a PC. Sorry. I should have been clearer. Even locked, the software will install. With any luck, instead of just popping up the default keyboard, it will prompt you for which keyboard you wish to use.
Once the keyboard is installed (give it a few minutes), then press and hold the power button to shut the phone off. Then try and boot it up. If you don't have a data connection or are not connected to a wifi data source and set to install over wifi only, then your options are limited.
Maybe booting in safe mode might get you past the lock screen long enough to clear the data for the stock keyboard.
To boot in safe mode, press and hold the power button until you see the power off prompt. Then press and hold the power off selection until you see the option to boot into safe mode.