# Unicorn pHAT install failing

**URL:** <https://forums.pimoroni.com/t/unicorn-phat-install-failing/15035>\
**Category:** Support\
**Created:** [October 1, 2020, 4:24pm UTC](https://forums.pimoroni.com/t/unicorn-phat-install-failing/15035 "2020-10-01T16:24:09Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![foilking](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/foilking/32/7183_2.png) [@foilking](https://forums.pimoroni.com/u/foilking)\
**Post date:** [October 1, 2020, 4:24pm UTC](https://forums.pimoroni.com/t/unicorn-phat-install-failing/15035/1 "2020-10-01T16:24:09Z")

</div>

Trying to install the Unicorn HAT Python library on my Raspberry Pi Zero and getting this error message:

```
Installing Unicorn HAT/pHAT library for Python 2...

```

Collecting unicornhat  
Using cached [https://files.pythonhosted.org/packages/84/81/bd52bd6119e5b807adf975b33c310c167013afd27bcc1c98cd21e91b45e2/unicornhat-2.2.3.tar.gz](https://files.pythonhosted.org/packages/84/81/bd52bd6119e5b807adf975b33c310c167013afd27bcc1c98cd21e91b45e2/unicornhat-2.2.3.tar.gz)  
Collecting rpi\_ws281x\>=3.0.3 (from unicornhat)  
Using cached [https://files.pythonhosted.org/packages/3b/99/0f74f2d303e03432d10b11dab240cb15afad1bc6ab9a1449c9bc08af2ee4/rpi\_ws281x-4.2.4.tar.gz](https://files.pythonhosted.org/packages/3b/99/0f74f2d303e03432d10b11dab240cb15afad1bc6ab9a1449c9bc08af2ee4/rpi_ws281x-4.2.4.tar.gz)  
Building wheels for collected packages: unicornhat, rpi-ws281x  
Running setup.py bdist\_wheel for unicornhat … error  
Complete output from command /usr/bin/python -u -c “import setuptools, tokenize; **file** =’/tmp/pip-install-smK8xJ/unicornhat/setup.py’;f=getattr(tokenize, ‘open’, open)( **file** );code=f.read().replace(’\r\n’, ‘\n’);f.close();exec(compile(code, **file** , ‘exec’))” bdist\_wheel -d /tmp/pip-wheel-j6gHzq --python-tag cp27:  
usage: -c [global\_opts] cmd1 [cmd1\_opts] [cmd2 [cmd2\_opts] …]  
or: -c --help [cmd1 cmd2 …]  
or: -c --help-commands  
or: -c cmd --help

error: invalid command ‘bdist\_wheel’

* * *

Failed building wheel for unicornhat  
Running setup.py clean for unicornhat  
Running setup.py bdist\_wheel for rpi-ws281x … error  
Complete output from command /usr/bin/python -u -c “import setuptools, tokenize; **file** =’/tmp/pip-install-smK8xJ/rpi-ws281x/setup.py’;f=getattr(tokenize, ‘open’, open)( **file** );code=f.read().replace(’\r\n’, ‘\n’);f.close();exec(compile(code, **file** , ‘exec’))” bdist\_wheel -d /tmp/pip-wheel-PQTJlW --python-tag cp27:  
usage: -c [global\_opts] cmd1 [cmd1\_opts] [cmd2 [cmd2\_opts] …]  
or: -c --help [cmd1 cmd2 …]  
or: -c --help-commands  
or: -c cmd --help

error: invalid command ‘bdist\_wheel’

* * *

Failed building wheel for rpi-ws281x  
Running setup.py clean for rpi-ws281x  
Failed to build unicornhat rpi-ws281x  
Installing collected packages: rpi-ws281x, unicornhat  
Running setup.py install for rpi-ws281x … error  
Complete output from command /usr/bin/python -u -c “import setuptools, tokenize; **file** =’/tmp/pip-install-smK8xJ/rpi-ws281x/setup.py’;f=getattr(tokenize, ‘open’, open)( **file** );code=f.read().replace(’\r\n’, ‘\n’);f.close();exec(compile(code, **file** , ‘exec’))” install --record /tmp/pip-record-IDRE8m/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  
creating build/lib.linux-armv6l-2.7/rpi\_ws281x  
copying rpi\_ws281x/rpi\_ws281x.py -\> build/lib.linux-armv6l-2.7/rpi\_ws281x  
copying rpi\_ws281x/ **init**.py -\> build/lib.linux-armv6l-2.7/rpi\_ws281x  
running build\_ext  
building ‘\_rpi\_ws281x’ extension  
creating build/temp.linux-armv6l-2.7  
creating build/temp.linux-armv6l-2.7/lib  
arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D\_FORTIFY\_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-InigCj/python2.7-2.7.16=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I. -I/usr/include/python2.7 -c rpi\_ws281x\_wrap.c -o build/temp.linux-armv6l-2.7/rpi\_ws281x\_wrap.o  
unable to execute ‘arm-linux-gnueabihf-gcc’: No such file or directory  
error: command ‘arm-linux-gnueabihf-gcc’ failed with exit status 1

```
----------------------------------------

```

Command “/usr/bin/python -u -c “import setuptools, tokenize; **file** =’/tmp/pip-install-smK8xJ/rpi-ws281x/setup.py’;f=getattr(tokenize, ‘open’, open)( **file** );code=f.read().replace(’\r\n’, ‘\n’);f.close();exec(compile(code, **file** , ‘exec’))” install --record /tmp/pip-record-IDRE8m/install-record.txt --single-version-externally-managed --compile” failed with error code 1 in /tmp/pip-install-smK8xJ/rpi-ws281x/  
Python 2 library install failed!

Any suggestions?

---

<div class="post-metadata">

**Author:** ![alphanumeric](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/alphanumeric/32/2729_2.png) [@alphanumeric](https://forums.pimoroni.com/u/alphanumeric)\
**Post date:** [October 1, 2020, 5:37pm UTC](https://forums.pimoroni.com/t/unicorn-phat-install-failing/15035/2 "2020-10-01T17:37:32Z")

</div>

Just double checking its the Hat and not the Mini or HD.  
If yes try  
`sudo apt-get install python3-pip python3-dev`  
`sudo pip3 install unicornhat`  
and  
`sudo apt-get install python-pip python-dev`  
`sudo pip install unicornhat`

---

<div class="post-metadata">

**Author:** ![foilking](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/foilking/32/7183_2.png) [@foilking](https://forums.pimoroni.com/u/foilking)\
**Post date:** [October 1, 2020, 5:45pm UTC](https://forums.pimoroni.com/t/unicorn-phat-install-failing/15035/3 "2020-10-01T17:45:06Z")

</div>

Just tried those commands, it fails on the `sudo pip install unicornhat` command saying

> Failed building wheel for unicornhat  
> Failed building wheel for rpi-ws281x

---

<div class="post-metadata">

**Author:** ![alphanumeric](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/alphanumeric/32/2729_2.png) [@alphanumeric](https://forums.pimoroni.com/u/alphanumeric)\
**Post date:** [October 1, 2020, 8:45pm UTC](https://forums.pimoroni.com/t/unicorn-phat-install-failing/15035/4 "2020-10-01T20:45:47Z")

</div>

pip installs for python 2 and pip3 for python3. If the pip3 didn’t error out you can try running an example in python3.
