# Unicorn Hat on Raspbian Jessie

**URL:** <https://forums.pimoroni.com/t/unicorn-hat-on-raspbian-jessie/1202>\
**Category:** Support\
**Created:** [November 10, 2015, 9:07am UTC](https://forums.pimoroni.com/t/unicorn-hat-on-raspbian-jessie/1202 "2015-11-10T09:07:37Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Richard238](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard238](https://forums.pimoroni.com/u/Richard238)\
**Post date:** [November 10, 2015, 9:07am UTC](https://forums.pimoroni.com/t/unicorn-hat-on-raspbian-jessie/1202/1 "2015-11-10T09:07:37Z")

</div>

This might help someone:

I formatted a spare SD card and loaded NOOBS.

Installed Raspbian Jessie, and ran the : _sudo pip install unicornhat --upgrade_ command

Failed.

Searched on this error message: Python.h: No such file or directory

Ran this command _sudo apt-get install python2.7-dev_

Re-ran the : _sudo pip install unicornhat --upgrade_ command

Seems OK, yet to be tested fully.

Full text of error:

pi@raspberrypi ~ $ sudo pip install unicornhat --upgrade  
Downloading/unpacking unicornhat  
Downloading unicornhat-2.0.4.tar.gz  
Running [setup.py](http://setup.py) (path:/tmp/pip-build-KaRTg6/unicornhat/setup.py) egg\_info for package unicornhat

Downloading/unpacking rpi-ws281x\>=1.1.0 (from unicornhat)  
Downloading rpi\_ws281x-1.2.1.tar.gz (117kB): 117kB downloaded  
Running [setup.py](http://setup.py) (path:/tmp/pip-build-KaRTg6/rpi-ws281x/setup.py) egg\_info for package rpi-ws281x

Installing collected packages: unicornhat, rpi-ws281x  
Running [setup.py](http://setup.py) install for unicornhat

Running [setup.py](http://setup.py) install for rpi-ws281x  
Compiling ws281x library…  
building ‘\_rpi\_ws281x’ extension  
arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -D\_FORTIFY\_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -Ilib/ -I/usr/include/python2.7 -c rpi\_ws281x\_wrap.c -o build/temp.linux-armv6l-2.7/rpi\_ws281x\_wrap.o  
rpi\_ws281x\_wrap.c:125:20: fatal error: Python.h: No such file or directory  
#include \<Python.h\>  
^  
compilation terminated.  
error: command ‘arm-linux-gnueabihf-gcc’ failed with exit status 1  
Complete output from command /usr/bin/python -c “import setuptools, tokenize; **file** =’/tmp/pip-build-KaRTg6/rpi-ws281x/setup.py’;exec(compile(getattr(tokenize, ‘open’, open)( **file** ).read().replace(’\r\n’, ‘\n’), **file** , ‘exec’))” install --record /tmp/pip-M5rcJA-record/install-record.txt --single-version-externally-managed --compile:  
running install

running build

running build\_py

Compiling ws281x library…

creating build

creating build/lib.linux-armv6l-2.7

copying [neopixel.py](http://neopixel.py) -\> build/lib.linux-armv6l-2.7

running build\_ext

building ‘\_rpi\_ws281x’ extension

creating build/temp.linux-armv6l-2.7

arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -D\_FORTIFY\_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -Ilib/ -I/usr/include/python2.7 -c rpi\_ws281x\_wrap.c -o build/temp.linux-armv6l-2.7/rpi\_ws281x\_wrap.o

rpi\_ws281x\_wrap.c:125:20: fatal error: Python.h: No such file or directory

#include \<Python.h\>

```
                ^

```

compilation terminated.

error: command ‘arm-linux-gnueabihf-gcc’ failed with exit status 1

* * *

Cleaning up…  
Command /usr/bin/python -c “import setuptools, tokenize; **file** =’/tmp/pip-build-KaRTg6/rpi-ws281x/setup.py’;exec(compile(getattr(tokenize, ‘open’, open)( **file** ).read().replace(’\r\n’, ‘\n’), **file** , ‘exec’))” install --record /tmp/pip-M5rcJA-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /tmp/pip-build-KaRTg6/rpi-ws281x  
Storing debug log for failure in /root/.pip/pip.log

---

<div class="post-metadata">

**Author:** ![RogueM](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/roguem/32/311_2.png) [@RogueM](https://forums.pimoroni.com/u/RogueM)\
**Post date:** [November 10, 2015, 9:36am UTC](https://forums.pimoroni.com/t/unicorn-hat-on-raspbian-jessie/1202/2 "2015-11-10T09:36:34Z")

</div>

Yes, I think at this point it’s preferable to use the scripts that take care of dependencies, in this instance:

curl [https://get.pimoroni.com/unicornhat](https://get.pimoroni.com/unicornhat) | bash

… I have it on good authority it will even get easier in the near future, but mum’s the word ;-)

---

<div class="post-metadata">

**Author:** ![federicogasp](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/federicogasp/32/58_2.png) [@federicogasp](https://forums.pimoroni.com/u/federicogasp)\
**Post date:** [November 10, 2015, 9:51pm UTC](https://forums.pimoroni.com/t/unicorn-hat-on-raspbian-jessie/1202/3 "2015-11-10T21:51:15Z")

</div>

I have the same problem, unfortunately.

Moreover if I try to use **curl [https://get.pimoroni.com/unicornhat](https://get.pimoroni.com/unicornhat) | bash** after it downloads the packages I get this output:

_Reading package lists… Done_

_Installing UnicornHat requirements…_

_Checking for python-pip…_  
_python-pip already installed._

That’s it, nothing else. Any help?

---

<div class="post-metadata">

**Author:** ![RogueM](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/roguem/32/311_2.png) [@RogueM](https://forums.pimoroni.com/u/RogueM)\
**Post date:** [November 10, 2015, 10:04pm UTC](https://forums.pimoroni.com/t/unicorn-hat-on-raspbian-jessie/1202/4 "2015-11-10T22:04:29Z")

</div>

I just checked the github and I think there was a problem with the script… it’s been fixed but maybe not pushed to the site yet, sorry about that!

what happens if you do:

```
sudo apt-get install python-pip python-dev
sudo pip install unicornhat
```

---

<div class="post-metadata">

**Author:** ![RogueM](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/roguem/32/311_2.png) [@RogueM](https://forums.pimoroni.com/u/RogueM)\
**Post date:** [November 10, 2015, 10:26pm UTC](https://forums.pimoroni.com/t/unicorn-hat-on-raspbian-jessie/1202/5 "2015-11-10T22:26:35Z")

</div>

hum, no the script on the site is definitely the right one, so should have worked. Is this on Jessie?  
have you updated it recently with:

```
sudo apt-get update
sudo apt-get upgrade
```

---

<div class="post-metadata">

**Author:** ![RogueM](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/roguem/32/311_2.png) [@RogueM](https://forums.pimoroni.com/u/RogueM)\
**Post date:** [November 18, 2015, 12:18am UTC](https://forums.pimoroni.com/t/unicorn-hat-on-raspbian-jessie/1202/6 "2015-11-18T00:18:52Z")

</div>

```
curl https://get.pimoroni.com/unicornhat | bash

```

should now work again on Jessie!

---

<div class="post-metadata">

**Author:** ![Richard238](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard238](https://forums.pimoroni.com/u/Richard238)\
**Post date:** [November 19, 2015, 9:46am UTC](https://forums.pimoroni.com/t/unicorn-hat-on-raspbian-jessie/1202/7 "2015-11-19T09:46:46Z")

</div>

And when you’ve seen enough blinky rainbows, how do you stop the Unicorn Hat?

Ending the .py just freezes the coloured lights, how do you get them all to go off.

If possible, I’d rather not shut-down or reboot the Pi.

---

<div class="post-metadata">

**Author:** ![RogueM](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/roguem/32/311_2.png) [@RogueM](https://forums.pimoroni.com/u/RogueM)\
**Post date:** [November 20, 2015, 12:42am UTC](https://forums.pimoroni.com/t/unicorn-hat-on-raspbian-jessie/1202/8 "2015-11-20T00:42:44Z")

</div>

open an interactive shell then:

```
>>> import unicornhat
>>> unicornhat.off()
```
