We Are Going To Discuss About VS/Pylance warning: import “module” could not be resolved. So lets Start this Python Article.
VS/Pylance warning: import “module” could not be resolved
- How to solve VS/Pylance warning: import “module” could not be resolved
If I understand your problem correctly, your python environment is properly set (for you are able to run your code) but your IDE (Vs code) points import errors.
That is probably because your IDE does not know which python environment use for your current project (which seems to live somewhere in/home/imantha/workspace/python
). You need to set it to get rid of this warning https://code.visualstudio.com/docs/python/environments - VS/Pylance warning: import “module” could not be resolved
If I understand your problem correctly, your python environment is properly set (for you are able to run your code) but your IDE (Vs code) points import errors.
That is probably because your IDE does not know which python environment use for your current project (which seems to live somewhere in/home/imantha/workspace/python
). You need to set it to get rid of this warning https://code.visualstudio.com/docs/python/environments
Solution 1
If I understand your problem correctly, your python environment is properly set (for you are able to run your code) but your IDE (Vs code) points import errors.
That is probably because your IDE does not know which python environment use for your current project (which seems to live somewhere in /home/imantha/workspace/python
). You need to set it to get rid of this warning https://code.visualstudio.com/docs/python/environments
Original Author zar3bski Of This Content
Solution 2
Manage to figure it out.
I was using jupyter in vscode, and in addition changing its (jupyter) environment – which was the correct one,
I also had to change .py file environments (which was a different env before)
And that removed the warnings.
Original Author zar3bski Of This Content
Conclusion
So This is all About This Tutorial. Hope This Tutorial Helped You. Thank You.