Traceback (most recent call last):
File "main.py", line 6, in <module>
from pyrogram import (
File "/usr/local/lib/python3.6/dist-packages/pyrogram/__init__.py", line 39, in <module>
from .client import *
File "/usr/local/lib/python3.6/dist-packages/pyrogram/client/__init__.py", line 19, in <module>
from .client import Client
File "/usr/local/lib/python3.6/dist-packages/pyrogram/client/client.py", line 43, in <module>
from pyrogram.client.methods.password.utils import compute_check
File "/usr/local/lib/python3.6/dist-packages/pyrogram/client/methods/__init__.py", line 19, in <module>
from .bots import Bots
File "/usr/local/lib/python3.6/dist-packages/pyrogram/client/methods/bots/__init__.py", line 19, in <module>
from .answer_callback_query import AnswerCallbackQuery
File "/usr/local/lib/python3.6/dist-packages/pyrogram/client/methods/bots/answer_callback_query.py", line 20, in <module>
from pyrogram.client.ext import BaseClient
File "/usr/local/lib/python3.6/dist-packages/pyrogram/client/ext/__init__.py", line 19, in <module>
from .base_client import BaseClient
File "/usr/local/lib/python3.6/dist-packages/pyrogram/client/ext/base_client.py", line 30, in <module>
class BaseClient:
File "/usr/local/lib/python3.6/dist-packages/pyrogram/client/ext/base_client.py", line 88, in BaseClient
FileData = namedtuple("FileData", fields, defaults=(None,) * len(fields))
TypeError: namedtuple() got an unexpected keyword argument 'defaults'
手贱执行了一下
pip3 install -U https://github.com/pyrogram/pyrogram/archive/asyncio.zip
,然后就悲剧了,下面是运行的错误日志。查到的原因
https://stackoverflow.com/questions/11351032/namedtuple-and-default-values-for-optional-keyword-arguments
解决方法
装一个python3.7然后重新装一下依赖,完美运行。