[Python] Cannot import 'WebClient' and 'SlackApiError' from slack_sdk in Python

Discussão em 'Python' iniciado por Stack, Maio 20, 2025.

  1. Stack

    Stack Membro Participativo

    I'm trying to send a message to Slack using Python and the slack_sdk library, but I'm getting an import error.

    from slack_sdk import WebClient
    from slack_sdk.errors import SlackApiError


    The IDE (VS Code) is underlining both WebClient and SlackApiError with a warning. I've already installed the package using:

    pip install slack_sdk


    My environment:

    Python 3.11
    VS Code
    slack_sdk version 3.26.1 (installed via pip)
    Virtual environment active


    I have verified that the package is installed correctly. Why am I getting this warning, and how can I fix it?

    Any help would be appreciated!

    What I've tried:

    • Restarting VS Code
    • Reinstalling the package
    • Checking spelling and import paths

    Continue reading...

Compartilhe esta Página