Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python unresolved import issue #5786

Closed
chudytom opened this issue May 26, 2019 · 1 comment
Closed

Python unresolved import issue #5786

chudytom opened this issue May 26, 2019 · 1 comment

Comments

@chudytom
Copy link

Environment data

  • VS Code version: 1.34.0
  • Extension version (available under the Extensions sidebar): 2019.4.12954
  • OS and version: Windows 10 v. 1809
  • Python version (& distribution if applicable, e.g. Anaconda): 3.5.2 64-bit without Conda
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): I guess I have no venv set up.
  • Relevant/affected Python packages and their versions: Microsoft Python Language Server v. 0.2.86

Actual behaviour

I open VSCode in a root folder where all my code exists. Part of it looks like this:

  • workspaceRootFolder
    • .vscode
    • network
      • section_network_input.py
    • timepredictionslib
      • build
      • dist
      • timepredictionslib
        • Here in subfolders are all my classes in the module
    • .env

In the 'network' folder I have some script that I run straight from PowerShell whereas in 'timepredictionslib' I have my custom module where I store all reuasuable classes.

All code runs smooth when run by the Python interpreter, however when I disabled Jedi and switched to Microsoft Python Language Server I get the 'unresolved import' error
image

I already added the '.env' file with the following content:
PYTHONPATH=timepredictionslib

and added the file as python.envFile as was advised here:
#3840 (comment)

Also I added python.autoComplete.extraPaths as was proposed here:
microsoft/python-language-server#1099

But none of these helped. Do you guys have any idea what else I need to do for the Lanugage Server to discover my library?

One more thing. When I tried to update the first import presented in the attached screen it is then discovered by the Language Server and IntelliSense but not by Pylint and the Python interpreter:
image

Steps to reproduce:

If needed I will create a smaller project with similiar configuration and push it to GutHub.

Logs

Output for Python in the Output panel
image

settings.json for Python

image

@DonJayamanne
Copy link

Issue moved to microsoft/python-language-server #1137 via ZenHub

@ghost ghost removed the triage-needed Needs assignment to the proper sub-team label May 28, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Jun 4, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants