Install & Compatibility
Where this runs
tested against v11.0.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.756s · 25.9MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 2.6s · import 0.664s · 27MB
25MB installed
● package 25MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
Client
✓ from twitter_ads.client import Client
✗ import twitter_ads
Client is the main entry point, not a top-level import.
Account
✓ from twitter_ads.account import Account
Initialize client and list all accounts.
import os
from twitter_ads.client import Client
CONSUMER_KEY = os.environ.get('CONSUMER_KEY', '')
CONSUMER_SECRET = os.environ.get('CONSUMER_SECRET', '')
ACCESS_TOKEN = os.environ.get('ACCESS_TOKEN', '')
ACCESS_TOKEN_SECRET = os.environ.get('ACCESS_TOKEN_SECRET', '')
client = Client(CONSUMER_KEY, CONSUMER_SECRET, ACCESS_TOKEN, ACCESS_TOKEN_SECRET)
print(client.accounts.all())
Errors
Common errors & fixes
ImportError: No module named 'twitter_ads'
Package not installed or installed in wrong environment.
fixRun 'pip install twitter-ads' and ensure virtual environment is activated.
twitter_ads.client.Client() missing 2 required positional arguments: 'access_token' and 'access_token_secret'
Old instantiation pattern with only two arguments (consumer key/secret) used in OAuth2 flow but API requires OAuth1 with four tokens.
fixProvide all four OAuth1 credentials: consumer_key, consumer_secret, access_token, access_token_secret.
Upgrade
Version history
11.0.0latest on PyPI · released May 27, 2022
Audit
Dependencies
No dependency data recorded yet.