Python 3.x 为什么telethon不能与tor bundle一起工作

Python 3.x 为什么telethon不能与tor bundle一起工作,python-3.x,tor,telethon,Python 3.x,Tor,Telethon,我的操作系统Windows 10。我用tor bundle设置了本地代理socks5。我正在使用python 3.8.1和telethon 1.10.10。但是我的代码不起作用 import socks import logging from telethon import TelegramClient, connection logging.basicConfig(level=logging.DEBUG) api_id = 123 api_hash = '123' client = Tele

我的操作系统Windows 10。我用tor bundle设置了本地代理socks5。我正在使用python 3.8.1和telethon 1.10.10。但是我的代码不起作用

import socks
import logging
from telethon import TelegramClient, connection

logging.basicConfig(level=logging.DEBUG)
api_id = 123
api_hash = '123'
client = TelegramClient('123', api_id, api_hash,
                                              proxy=(socks.SOCKS5, '127.0.0.1', 9050))

client.start()
电报服务连接日志

C:\source\untitled2\venv\Scripts\python.exe C:/source/untitled2/tele.py
DEBUG:asyncio:Using proactor: IocpProactor
INFO:telethon.network.mtprotosender:Connecting to 149.154.167.51:443/TcpFull...
DEBUG:telethon.network.mtprotosender:Connection attempt 1...
WARNING:telethon.network.mtprotosender:Attempt 1 at connecting failed: TimeoutError: 
DEBUG:telethon.network.mtprotosender:Connection attempt 2...
WARNING:telethon.network.mtprotosender:Attempt 2 at connecting failed: TimeoutError: 
DEBUG:telethon.network.mtprotosender:Connection attempt 3...
WARNING:telethon.network.mtprotosender:Attempt 3 at connecting failed: TimeoutError: 
DEBUG:telethon.network.mtprotosender:Connection attempt 4...
WARNING:telethon.network.mtprotosender:Attempt 4 at connecting failed: TimeoutError: 
DEBUG:telethon.network.mtprotosender:Connection attempt 5...
WARNING:telethon.network.mtprotosender:Attempt 5 at connecting failed: TimeoutError: 
DEBUG:telethon.network.mtprotosender:Connection attempt 6...
WARNING:telethon.network.mtprotosender:Attempt 6 at connecting failed: TimeoutError: 

您是否确定代理已正确配置(是否在该IP、该端口中配置了SOCKS5)@Lonami是的,我的电报桌面当前正在处理这些问题settings@Lonami我刚刚安装了Linux,这段代码在Linux中运行,也许这将帮助您改进代码