python-language-server icon indicating copy to clipboard operation
python-language-server copied to clipboard

There is now way to get rid of some "unresolved imports"

Open charles-dexter-ward opened this issue 5 years ago • 2 comments

Environment data

  • VS Code version: 1.45.0
  • Extension version (available under the Extensions sidebar): 2020.5.78807
  • OS and version: Windows 10
  • Python version (& distribution if applicable, e.g. Anaconda): 2.7.16
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): N/A
  • Relevant/affected Python packages and their versions: custom packages
  • Relevant/affected Python-related VS Code extensions and their versions:
  • Jedi or Language Server? (i.e. what is "python.jediEnabled" set to; more info microsoft/vscode-python#3977): Language Server
  • Value of the python.languageServer setting: "Microsoft"

Expected behaviour

Al custom imported packages should be found.

Actual behaviour

Some custom imported packages are treated as "unresolved imports", some others no.

Steps to reproduce:

  1. XXX image

Logs

I tried to use every known (to me) settings to define the PYTHONPATH:

"terminal.integrated.env.windows": {"PYTHONPATH": .....} "python.envFile": <path to a file containing a PYTHONPATH definition> "python.autoComplete.extraPaths": [ ..... ]

but some packages are always "unresolved imports"

In the image above, for example, _utils is found but not bp001_tbutenti. Even if both the folders are in the PYTHONPATH in every possible known setting.

charles-dexter-ward avatar May 13 '20 07:05 charles-dexter-ward

Have you looked into https://github.com/microsoft/python-language-server/blob/master/TROUBLESHOOTING.md#unresolved-import-warnings by any chance?

MikhailArkhipov avatar Jun 09 '20 17:06 MikhailArkhipov

Yes I have tried both envFile file and autoComplemete.extraPaths without success.

charles-dexter-ward avatar Jun 10 '20 19:06 charles-dexter-ward