The `slackclient` library is the legacy Python client for the Slack Web API and RTM API. Version 2.9.4 is the last release, and the project is officially deprecated. Users are strongly advised to migrate to the `slack-sdk` package, which is the actively maintained and officially supported Slack Python SDK. While `slackclient` v2.x shared similar import paths with `slack-sdk` (e.g., `from slack import WebClient`), the `slack-sdk` project has continued development and introduced new features and improvements.
pip install slackclientVerified import paths — ran on the pinned version, not inferred.
This example demonstrates how to send a message to a Slack channel using the `WebClient` from the `slackclient` library (v2.x). Ensure you have a Slack bot token (`SLACK_BOT_TOKEN`) set as an environment variable or hardcoded for testing. This pattern is similar to `slack-sdk`, but future compatibility and new features are only available in `slack-sdk`.
Uninstall `slackclient` (`pip uninstall slackclient`) and install `slack-sdk` (`pip install slack-sdk`). Update your import statements and code to use `slack_sdk` if you were relying on implicit `slackclient` features.
Refactor your code to use `WebClient` and `RTMClient` (now part of `slack-sdk`) and adapt to the new method signatures and argument requirements, especially around token handling and API call patterns.
Always explicitly install and use `slack-sdk` (`pip install slack-sdk`) to ensure you're on the actively maintained version. Verify your installed packages with `pip freeze | grep slack`.
Use the `api_call` method instead: `client.api_call('chat.postMessage', channel='C12345', text='Hello!')`.Update your import statement to `from slack import WebClient` and instantiate with `client = WebClient(token=SLACK_BOT_TOKEN)`.
Ensure `slackclient` v2.x (or `slack-sdk`) is installed via `pip install slackclient` (or `pip install slack-sdk`) and use `from slack.errors import SlackApiError`.
Provide the API method name as the first argument, for example: `client.api_call('chat.postMessage', channel='C12345', text='Hello!')`.Provide your Slack bot or user token when initializing the client: `client = WebClient(token="xoxb-YOUR-TOKEN")`.
No dependency data recorded yet.