pylance-release
pylance-release copied to clipboard
Pylance can't resolve .pyw imports
Environment data
- Language Server version: v2020.11.2
- OS and version: Windows 10
- Python version: 3.8.3
Expected behaviour
from GSM import Backup (No error)
Actual behaviour
from GSM import Backup (Import "GSM" could not be resolvedPylance (reportMissingImports)) GSM is a .pyw file If I rename it to .py then it does resolve properly.
Code Snippet / Additional information
from GSM import Backup
# GSM is a .pyw file
Thanks for the suggestion. This is a less common scenario that we don't support yet.
This is a duplicate of #739. A more generic version of this issue
#739 was resolved (because it was fixed), but this issue is still an issue, and was not fixed. Could you please reopen this?
I am experiencing the same issue. My team developed a language on top of Python and Pylance can be a huge plus there. However, since the modules need to go through AST transformation, they end with "*.pyt" Pylance does not recognize such an extension. Maybe add some configuration that allows user to set what extensions Pylance should look for? I am using the latest release of Pylance at the moment.
Moving this issue to discussion as an enhancement request for comments and upvotes.