How do I compute feature importance for models?

The feature importance will be computed only for supervised learning problems. If the model built was an unsupervised one like k-means, feature importance will not be computed. Do let us know what model you were trying to train.