AttributeError: type object 'SpectrogramGenerator' has no attribute 'from_pretrained'
I'm working with PyCharm, using Python 3.7. 
In the following code snippet:
 `from nemo.collections.tts.models.base import SpectrogramGenerator, Vocoder`
`def load_spectrogram_model():`
    `pretrained_model = "tts_en_fastpitch"`
    `model = SpectrogramGenerator.from_pretrained(pretrained_model, override_config_path=None)`
    `return model`

`spec_gen = load_spectrogram_model().eval()`
I get the following error on the above line:
 `AttributeError: type object 'SpectrogramGenerator' has no attribute 'from_pretrained'`

Moreover, `print(SpectrogramGenerator.list_available_models())` returns an empty list. However, none of this is an issue in Colab. 
Is it something environment related or am I missing something? 

Any help would be appreciated.