I encountered the same problem. I rectified this by,
- Selecting the Python kernel in the vs code editor.
- Please check the environmental variables, and whether you have given the correct path variable.
- Finally pip install transformers torch.
Now set to go