twilio-python icon indicating copy to clipboard operation
twilio-python copied to clipboard

ImportError: No module named rest.ip_messaging

Open MichaelGradek opened this issue 10 years ago • 15 comments

Hi,

The first example I try to copy+paste from your docs does not seem to work. Looks like the imports are not working.

from twilio.rest.ip_messaging import TwilioIpMessagingClient
ImportError: No module named rest.ip_messaging

MichaelGradek avatar Jan 26 '16 09:01 MichaelGradek

Are you sure you are on the latest version of the library?

carlosdp avatar Jan 30 '16 02:01 carlosdp

@yfaber what extact version are you on?

carlosdp avatar Feb 08 '16 23:02 carlosdp

Possibly related, I couldn't find any reference in the docs (http://twilio-python.readthedocs.org/en/release-6x/) as to how to deal with access tokens for IPM?

The previous "from twilio.access_token import AccessToken, IpMessagingGrant" now returns:

ImportError: No module named access_token

Mac OS X 10.11 Beta (15A279b) Python 2.7.10 pip 8.0.2 twilio (6.0.0rc2)

Apols in advance if numpty question.

Rgds, Mick

mickstevens avatar Feb 10 '16 09:02 mickstevens

@mickstevens oh, are you using the 6.x release candidate? That library has different import directives. Check out https://github.com/twilio/twilio-python/wiki/Python-Version-6.x-Upgrade-Guide .

carlosdp avatar Feb 10 '16 19:02 carlosdp

@mickstevens sorry, that's our bad, a release candidate was mis-versioned and made the default download. You should download a 5.x version, unless you want to upgrade to the pre-release.

carlosdp avatar Feb 10 '16 19:02 carlosdp

@MichaelGradek @yfaber ^ that might be your issue as well

carlosdp avatar Feb 10 '16 19:02 carlosdp

I'm awarding myself a "No-Prize"! So basically IPM not supported yet in 6.0.0rc2? No biggie, like you say, I can rollback, was just keen to checkout the new secret sauce!

mickstevens avatar Feb 10 '16 20:02 mickstevens

@mickstevens it is, it's just all the subdomains in the new version are under twilio.rest.Client, so there isn't 1 client per subdomain now. (there's examples in the upgrade guide)

It's us that get no-prize, the RC shouldn't have been the default version =P

carlosdp avatar Feb 10 '16 20:02 carlosdp

Ok, so what's the solution to my problem statement/error msg above. Again I can't see any reference to Access Tokens in the upgrade guide or v6 docs?

mickstevens avatar Feb 10 '16 20:02 mickstevens

@mickstevens you know what, I don't think access tokens have been merged into the RC yet. I'll get that out for RC4 (RC3 is a small release today that makes auth more efficient). thanks!

Edit: that said, access tokens would work just as before, only the REST parts of the library are changed.

carlosdp avatar Feb 10 '16 21:02 carlosdp

This is getting a bit frustrating. Please actually read my comments before replying.

I repeat:

"So what's the solution to my problem statement/error msg above."

Hint: don't refer people to documentation before checking yourself that said documentation does actually contain the answer (or even exists).

Access Tokens clearly don't work "just as before" or I presumably wouldn't be getting the err msg. My code is based on https://www.twilio.com/docs/api/rest/access-tokens & https://www.twilio.com/docs/api/ip-messaging/guides/identity#create-token (pretty much the only documentation I can find)

mickstevens avatar Feb 10 '16 22:02 mickstevens

@mickstevens I apologize, when I originally directed you to the docs, I thought access tokens were in the RC and worked just as before. I've since noted that they are not in the 6.x.rc release candidate at the moment, that's a pre-release that still has a few kinks in it. If you need to use access tokens right now, you need to downgrade to a 5.x version or wait for the rc4 release.

So again, the solution is either downgrade to 5.x and use it exactly as you were trying to use it or wait for 6.0.rc4 and use it exactly as you were trying to use it.

carlosdp avatar Feb 10 '16 22:02 carlosdp

So (as I said 3 hrs ago) IPM, of which Access Tokens is an instrinsic part, is NOT currently supported in v6!

I implore you, for future reference, when responding to a customer "get it right first time, every time".

Looking fwd to your talk at Signal on this, expect some mild heckling (kidding, we'll laugh about it over a beer!).

Signing off & rolling back to v5... :'-(

mickstevens avatar Feb 10 '16 22:02 mickstevens

Hey @mickstevens, @MichaelGradek,

Sorry this has been quiet for such a long time. I've just taken a look through the repo and it looks like IP Messaging access tokens were added in v6 rc3 here: https://github.com/twilio/twilio-python/commit/3c474e5584c7c3ebefc228666fb3e286571d0899.

Have you tried using the latest release candidate with this? Can we close this issue?

Thanks!

philnash avatar Jul 28 '16 21:07 philnash

hey @mickstevens @MichaelGradek!

Twilio Programmable Chat has been added in the latest release of the library!

jingming avatar Apr 05 '17 14:04 jingming