At the time of development with VS Code (Python3), the import error of the self-made module placed in the same layer as the executable file could not be solved by any means, and I was addicted to it, so I shared the countermeasures. To write the conclusion first, it was just an omission of autocomplete settings. .. ..
--When importing a self-made class placed in the same hierarchy as the executable file, the "unresolved import" error does not disappear --There is an error on the display, but when I run the program, it works fine.
Added "python.autoComplete.extraPaths" to workspace settings (settings.json), It is OK if you describe the Path of the folder where your own module is located. The example this time is as follows.
settings.json
{
"python.autoComplete.extraPaths": ["./src/get_tweet_data"]
}
-What to do when "unresolved import" appears in VS Code for some reason | Hobby Gramma Blog -Enable autocomplete in Visual Studio Code Python development environment | MIRAIUM
Recommended Posts