Carinstan
Carinstan

Reputation: 11

Using print() in twilio

After I installed twilio, I use print(twillio.version):

import twilio

print(twilio.version)

there's an error:

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'version'

Upvotes: 0

Views: 61

Answers (2)

Matteus
Matteus

Reputation: 117

While not all Python modules support it (so I'm not sure about Twilio), you can try to execute twilio.__version__ instead.

If that doesn't work, maybe first try executing twilio -v or twilio --version on the command line to see if the module has been installed properly, or to get the version number like that.

Hope this helps!

Upvotes: 2

The Pjot
The Pjot

Reputation: 1859

Not sure which version of Twilion you installed. But 6.19.1 has __version__, not version on module level.

>>> import twilio
>>> dir(twilio)
['__builtins__', '__doc__', '__file__', '__name__', '__package__', '__path__',     '__version__', '__version_info__']
>>> twilio.__version__
'6.19.1'

Upvotes: 2

Related Questions