Skip to content

Cannot globally set Import Strategy #581

@julianstirling

Description

@julianstirling

Diagnostic Data

  • Python version (& distribution if applicable, e.g., Anaconda): Varies, mostly 3.10 or 3.12
  • Type of virtual environment used (e.g., conda, venv, virtualenv, etc.): vitrualenv
  • Operating system (and version): Kubuntu 24.04
  • Version of tool extension you are using: v2024.0.0

Behaviour

Expected Behavior

  • Packages installed in this virtualenv available to PyLint
  • Setting a Import Strategy at user level would apply to all projects

Actual Behavior

  • PyLint doesn't find certain packages. I think these are mostly ones that are installed with pip install -e, but may also be other packages in the current environment. This leads to lots of linting errors.
  • The linting errors go away if Import Strategy is set to fromEnvironment for the Workspace.
  • If Import Strategy is set to fromEnvironment for User settings. I would expect this to apply to all workspaces where this setting is not set? However, every workspace needs manually setting to fromEnvironment.

Reproduction Steps:

  • Create a virtual environment for a project.
  • Install the project with pip install -e .
  • Open in VSCode
  • Let pylint run on a file the imports from the project.

Logs:

I haven't taken any logs. Please let me know if they would be helpful

Outcome When Attempting Debugging Steps:

Did running it from the command line work? Pylint works fine from command line or if "fromEnvironment" is set.

Extra Details

Not that I can think of.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIssue identified by VS Code Team member as probable buggood first issueGood for newcomershelp wantedIssues identified as good community contribution opportunitiesneeds PR

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions