This problem was occurring because of the python IntelliSense extension that I was using on vs code In the current version they have fixed it somehow But if somebody is facing an issue like this you can turn off your IntelliSense or just ignore the yellow line