Я использую Twilio в Python, но получаю ModuleNotFoundErrorPython

Программы на Python
Anonymous
Я использую Twilio в Python, но получаю ModuleNotFoundError

Сообщение Anonymous »

Код: Выделить всё

ModuleNotFoundError: No module named 'twilio.rest.api.v2010.account.sip.domain.auth_types.auth_type_registrations.auth_registrations_credential_list_mapping'

Код: Выделить всё

import os
from twilio.rest import Client

# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = "MY_ACCOUNT_SID"
auth_token = "MY_AUTH_TOKEN"
client = Client(account_sid, auth_token)

message = client.messages \
.create(
body="Join Earth's mightiest heroes. Like Kevin Bacon.",
from_='NUMBER',
to='NUMBER'
)

print(message.sid)

Код: Выделить всё

Traceback (most recent call last):
File "d:\code\python\100-days-of-code\Section 35\rain_alert\sample.py", line 12, in 
message = client.messages \
File "C:\Users\smitk\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\twilio\rest\__init__.py", line 676, in messages
return self.api.account.messages
File "C:\Users\smitk\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\twilio\rest\__init__.py", line 183, in api
from twilio.rest.api import Api
File "C:\Users\smitk\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\twilio\rest\api\__init__.py", line 3, in 
from twilio.rest.api.ApiBase import ApiBase
File "C:\Users\smitk\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\twilio\rest\api\ApiBase.py", line 16, in 
from twilio.rest.api.v2010 import V2010
File "C:\Users\smitk\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\twilio\rest\api\v2010\__init__.py", line 18, in 
from twilio.rest.api.v2010.account import AccountList
File "C:\Users\smitk\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\twilio\rest\api\v2010\account\__init__.py", line 47, in 
from twilio.rest.api.v2010.account.sip import SipList
File "C:\Users\smitk\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\twilio\rest\api\v2010\account\sip\__init__.py", line 23, in 
from twilio.rest.api.v2010.account.sip.domain import DomainList
File "C:\Users\smitk\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\twilio\rest\api\v2010\account\sip\domain\__init__.py", line 24, in 
from twilio.rest.api.v2010.account.sip.domain.auth_types import AuthTypesList
File "C:\Users\smitk\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\twilio\rest\api\v2010\account\sip\domain\auth_types\__init__.py", line 25, in 
from twilio.rest.api.v2010.account.sip.domain.auth_types.auth_type_registrations import (
File "C:\Users\smitk\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\twilio\rest\api\v2010\account\sip\domain\auth_types\auth_type_registrations\__init__.py", line 22, in 
from twilio.rest.api.v2010.account.sip.domain.auth_types.auth_type_registrations.auth_registrations_credential_list_mapping import (
ModuleNotFoundError: No module named 'twilio.rest.api.v2010.account.sip.domain.auth_types.auth_type_registrations.auth_registrations_credential_list_mapping'
Я думаю, проблема в пакете twilio. Поэтому я переустанавливаю пакет, но каждый раз получаю одну и ту же ошибку.

Подробнее здесь: https://stackoverflow.com/questions/764 ... founderror

Вернуться в «Python»