twilio / twilio-python

A Python module for communicating with the Twilio API and generating TwiML.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ModuleNotFoundError: No module named 'twilio.rest.preview.understand'

CristhianMotoche opened this issue · comments

Issue Summary

Error when trying to run a code sample related to the preview domain

Steps to Reproduce

  1. Run the following code sample

Code Snippet

# Download the helper library from https://www.twilio.com/docs/python/install
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 = os.environ['TWILIO_ACCOUNT_SID']
auth_token = os.environ['TWILIO_AUTH_TOKEN']
client = Client(account_sid, auth_token)

installed_add_ons = client \
                   .preview \
                   .marketplace \
                   .installed_add_ons.list(limit=20)

for record in installed_add_ons:
    print(record.sid)

Exception/Log

STDERR:Traceback (most recent call last):
  File "//./python_runner", line 66, in run_snippet
    exec(snippet['code'])
  File "<string>", line 12, in <module>
  File "/usr/local/lib/python3.11/site-packages/twilio/rest/__init__.py", line 414, in preview
    from twilio.rest.preview import Preview
  File "/usr/local/lib/python3.11/site-packages/twilio/rest/preview/__init__.py", line 12, in <module>
    from twilio.rest.preview.understand.assistant import AssistantList
ModuleNotFoundError: No module named 'twilio.rest.preview.understand'

Technical details:

  • twilio-python version: 8.13.0
  • python version: 3.11.6

I am looking into this. Thanks!

#775 fixes this