# Attribute Error Unicron pHat

**URL:** <https://forums.pimoroni.com/t/attribute-error-unicron-phat/6611>\
**Category:** Support\
**Created:** [December 12, 2017, 7:34pm UTC](https://forums.pimoroni.com/t/attribute-error-unicron-phat/6611 "2017-12-12T19:34:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![techboatman](https://avatars.discourse-cdn.com/v4/letter/t/5fc32e/32.png) [@techboatman](https://forums.pimoroni.com/u/techboatman)\
**Post date:** [December 12, 2017, 7:34pm UTC](https://forums.pimoroni.com/t/attribute-error-unicron-phat/6611/1 "2017-12-12T19:34:28Z")

</div>

So i have been trying to figure out my unicorn pHat the a while now with no luck. I have downloaded the files with curl [https://get.pimoroni.com/unicornhat](https://get.pimoroni.com/unicornhat) | bash then used sudo python and then type import unicornhat as uh. It all works fine to that point but then when i put in uh.set\_layout(uh.PHAT)  
as the tutorial shows it comes up with this “Traceback (most recent call last):  
File “”, line 1, in   
AttributeError: ‘module’ object has no attribute ‘set\_layout’” I have tried doing import uh.set\_layout but that didn’t work. It is probably completely wrong as I would still call myself a beginner. I am using python 2.7.9 and am on a raspberry pi 2 model b running raspbian jessie. I would really appreciate help and I will say a thank you in advance.

---

<div class="post-metadata">

**Author:** ![gadgetoid](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/gadgetoid/32/13_2.png) [@gadgetoid](https://forums.pimoroni.com/u/gadgetoid)\
**Post date:** [December 13, 2017, 10:50am UTC](https://forums.pimoroni.com/t/attribute-error-unicron-phat/6611/2 "2017-12-13T10:50:36Z")

</div>

Could you post your complete code? Use backticks to preserve formatting, like this:

````
```
formatted code goes here
```

````

If you’re using a REPL/Command Line and typing Python code line-by-line you can use `dir(uh)` to see what methods exist, and get an idea if something’s gone awry.

---

<div class="post-metadata">

**Author:** ![techboatman](https://avatars.discourse-cdn.com/v4/letter/t/5fc32e/32.png) [@techboatman](https://forums.pimoroni.com/u/techboatman)\
**Post date:** [December 13, 2017, 5:27pm UTC](https://forums.pimoroni.com/t/attribute-error-unicron-phat/6611/3 "2017-12-13T17:27:57Z")

</div>

Don’t worry, I think I’ve solved it. I was using the wrong python and I need to use python 3 (it didn’t say which one to use). But thank you for giving me the info for the code. It will be very handy in the future. `Thank You`
