42 lines
1.0 KiB
Python
42 lines
1.0 KiB
Python
#!/usr/bin/env python3
|
|
"""
|
|
Quick installer for telegram dependencies in notebook environment
|
|
"""
|
|
|
|
import subprocess
|
|
import sys
|
|
|
|
print("="*70)
|
|
print("📦 Installing Telegram Dependencies for Notebook")
|
|
print("="*70)
|
|
|
|
# Install python-telegram-bot
|
|
print("\n📥 Installing python-telegram-bot...")
|
|
try:
|
|
subprocess.check_call([
|
|
sys.executable, "-m", "pip", "install",
|
|
"python-telegram-bot==13.15",
|
|
"--upgrade"
|
|
])
|
|
print("✅ python-telegram-bot installed successfully!")
|
|
except Exception as e:
|
|
print(f"❌ Installation failed: {e}")
|
|
sys.exit(1)
|
|
|
|
# Verify installation
|
|
print("\n🧪 Verifying installation...")
|
|
try:
|
|
import telegram
|
|
from telegram import Bot
|
|
from telegram.ext import Updater
|
|
print(f"✅ telegram module imported successfully!")
|
|
print(f" Version: {telegram.__version__}")
|
|
except Exception as e:
|
|
print(f"❌ Verification failed: {e}")
|
|
sys.exit(1)
|
|
|
|
print("\n" + "="*70)
|
|
print("✅ ALL DEPENDENCIES INSTALLED!")
|
|
print("="*70)
|
|
print("\n📝 Next step: Run Cell 28 in your notebook again")
|