Twilio.rest missing from twilio python module version 2.0.8?

The Twilio python quick installation guide talks about a submodule called twilio.rest.

But after installing the twilio module today through sudo pip install twilio , which installed version 2.0.8, there is no module (or object) called "rest" in the twilio module.

Where is twilio.rest?

+1
source share
2 answers

There are two things you should check.

First, if you already have a package installed with pip , running pip install package-name will NOT update the package. To upgrade the package to the latest version, run

 pip install --upgrade twilio 

Secondly, we often see this error because people named the file containing their Twilio code twilio.py . This means that the attempt to import twilio.rest will fail because Python is looking in the twilio.py file for the .rest module. To solve the problem, use a different file name.

If you have more problems with the twilio module and ImportError , there is a full set of documentation here: http://readthedocs.org/docs/twilio-python/en/latest/faq.html#importerror-messages

+2
source

I had the same symptom, but my problem was what I called a handler like twilio.py. This caused a conflict with the twilio library. Just name your py file something else like phone.py.

+1
source

Source: https://habr.com/ru/post/1391348/


All Articles