Skip to content

PyLance / mypy doesn't accept opentelemetry as a namespace package #2591

@haf

Description

@haf

The opentelemetry-api package, exporting opentelemetry doesn't successfully import into vscode.

  1. In vanilla VSCode, the import opentelemetry is white

image

  1. In VSCode with mypy / pylance enabled with strict mode:

image

gives

image

It would seem this was solved a way back microsoft/pylance-release#555 but it's not

Describe your environment Describe any aspect of your environment relevant to the problem, including your Python version, platform, version numbers of installed dependencies, information about your cloud hosting provider, etc. If you're reporting a problem with a specific version of a library in this repo, please check whether the problem has been fixed on main.

  • Python v3.9.10, with venv
  • VSCode on macOS
  • Settings: image
  • Latest of all dependencies I could find

Steps to reproduce

Install "opentelemetry" and see the import in VSCode.

What is the expected behavior?

I'd expect typing to work.

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions