I had this error today on previously functional code - it turned out OneDrive was not started, and the file was in OneDrive and not local. Once I restarted, the issue was fixed.