pylance-release icon indicating copy to clipboard operation
pylance-release copied to clipboard

Pylance can't resolve .pyw imports

Open Concrete18 opened this issue 4 years ago • 4 comments

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

Concrete18 avatar Nov 21 '20 23:11 Concrete18

Thanks for the suggestion. This is a less common scenario that we don't support yet.

huguesv avatar Nov 23 '20 18:11 huguesv

This is a duplicate of #739. A more generic version of this issue

judej avatar Dec 15 '20 20:12 judej

#739 was resolved (because it was fixed), but this issue is still an issue, and was not fixed. Could you please reopen this?

Gaming32 avatar Jun 21 '22 20:06 Gaming32

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.

fadi721994 avatar Jul 26 '22 07:07 fadi721994

Moving this issue to discussion as an enhancement request for comments and upvotes.

debonte avatar Sep 01 '23 17:09 debonte