NODE MCU, python error

I was trying to compile the code in arduino IDE but I am getting the following error.-

Fatal Python error: initfsencoding: unable to load the file system codec
ModuleNotFoundError: No module named 'encodings'

Current thread 0x00000830 (most recent call first):
exit status -1073740791
Error compiling for board NodeMCU 0.9 (ESP-12 Module).

This error doesnt come when i compile for UNO board.
How to fix this??
Any help will be appreciated.

You have said elsewhere that the problem has been solved

Rather than delete the thread as you have suggested why not share the solution here as it may help others