Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community!
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.Start your free trial
Declan Smith453 Points
I entered hashlib.shake_128(b'Treehouse').hexdigest(20) and get back an error stating that there is no Attribute called shake_128
Traceback (most recent call last): File "<stdin>", line 1, in <module> AttributeError: 'module' object has no attribute 'shake_128'
Is my Terminal software missing anything or did I enter the wrong thing into Python?
Andrew Merrick20,151 Points
I've also gotten the same error but the machine I used had only Python 2.7 and, I believe, that shake_128 only works with Python 3. Not 100% accurate on that since the only documentation I can find is for Python 3.6.1.
Really cool lesson though!
Andrea Gomez8,609 Points
You have to import hashlib in order to use shake_128 so you should do the following:
>>> import hashlib >>> hashlib.shake_128(b'Treehouse').hexdigest(20) >>> '16254ff15a16c961a2e87bf54d2ddac477f1d0a1'
You can read more about shake_128 and hashlib in the official documentation