Unicorn pHat software installation on Raspberry Pi 3


In the middle of the setup process I get the following error message:

Installing Unicorn HAT/pHAT library for Python 2…
Compiling ws281x library…
Error: [Error 21] No such file or directory
If problem persist, visit forums.pimoroni.com for support


Hi, please post the full output, cherry picking as per above removes all context and makes it impossible to assess possible cause with any level of accuracy.


root@brian:~# git clone https://github.com/pimoroni/unicorn-hat
fatal: destination path ‘unicorn-hat’ already exists and is not an empty directory.
root@brian:~# cd unicorn-hat
root@brian:~/unicorn-hat# sudo apt-get install python-dev
Reading package lists… Done
Building dependency tree
Reading state information… Done
python-dev is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 21 not upgraded.
root@brian:~/unicorn-hat# cd library/rpi-ws281x
root@brian:~/unicorn-hat/library/rpi-ws281x# sudo python setup.py install
running install
running bdist_egg
running egg_info
writing rpi_ws281x.egg-info/PKG-INFO
writing top-level names to rpi_ws281x.egg-info/top_level.txt
writing dependency_links to rpi_ws281x.egg-info/dependency_links.txt
reading manifest file 'rpi_ws281x.egg-info/SOURCES.txt’
reading manifest template 'MANIFEST.in
writing manifest file 'rpi_ws281x.egg-info/SOURCES.txt’
installing library code to build/bdist.linux-armv7l/egg
running install_lib
running build_py
Compiling ws281x library…
error: [Errno 2] No such file or directory


hum, what OS is this? any particular reason you are not using the one-line installer?

also, I can’t really recommend running commands, even from any of our official repos, when logged in as root… you could easily end up with an unbootable system if you are not careful!


Sorry, but your forums software does not allows me to send you more details.


Were you trying to post a short text string, or an image? The latter I can fix, the former you can just work around with some extra words.


I was trying to send full output of a test as requested, which included
several web links.


D’oh! I’ve bumped your forum status a bit, hopefully it’ll work now. If not then stick it in Pastebin and drop the link here :D http://pastebin.com/

The forum can’t tell the difference between spam links and those you might see in an apt-get update.


I am trying to setup a Raspberry Pi 3 configuration as a Christmas gift for
my grandson, using a distro based on Raspbian Jessie called Kano, designed
for small children.

I tried the setup procedures suggested by Pimoroni and the results are as

1) Full install for beginners

root@brian:~# \curl -sS get.pimoroni.com/unicornhat | bash

This script will install everything needed to use
the Pimoroni Unicorn HAT/pHAT

— Warning —

Always be careful when running scripts and commands
copied from the internet. Ensure they are from a
trusted source.

If you want to see what this script does before
running it, you should run:
\curl -sS https://get.pimoroni.com/unicornhat

Do you wish to continue? [y/N] y

Checking environment…
Get:1 http://mirrordirector.raspbian.org jessie InRelease [14.9 kB]
Hit http://repo.kano.me release InRelease
Hit http://repo.kano.me release-urgent InRelease
Hit http://repo.kano.me jessie InRelease
Hit http://repo.kano.me release/main armhf Packages
Get:2 http://mirrordirector.raspbian.org jessie/main armhf Packages [8,981
Hit http://repo.kano.me release-urgent/main armhf Packages

Hit http://repo.kano.me jessie/main armhf Packages
Hit http://repo.kano.me jessie/ui armhf Packages
Ign http://repo.kano.me release/main Translation-en_US
Ign http://repo.kano.me release/main Translation-en
Ign http://repo.kano.me release-urgent/main Translation-en_US
Ign http://repo.kano.me release-urgent/main Translation-en
Ign http://repo.kano.me jessie/main Translation-en_US
Ign http://repo.kano.me jessie/main Translation-en
Ign http://repo.kano.me jessie/ui Translation-en_US
Ign http://repo.kano.me jessie/ui Translation-en
Get:3 http://mirrordirector.raspbian.org jessie/contrib armhf Packages
[37.5 kB]
Get:4 http://mirrordirector.raspbian.org jessie/non-free armhf Packages
[70.3 kB]
Get:5 http://mirrordirector.raspbian.org jessie/rpi armhf Packages [1,356 B]
Ign http://mirrordirector.raspbian.org jessie/contrib Translation-en_US
Ign http://mirrordirector.raspbian.org jessie/contrib Translation-en
Ign http://mirrordirector.raspbian.org jessie/main Translation-en_US
Ign http://mirrordirector.raspbian.org jessie/main Translation-en
Ign http://mirrordirector.raspbian.org jessie/non-free Translation-en_US
Ign http://mirrordirector.raspbian.org jessie/non-free Translation-en
Ign http://mirrordirector.raspbian.org jessie/rpi Translation-en_US
Ign http://mirrordirector.raspbian.org jessie/rpi Translation-en
Fetched 9,105 kB in 26s (345 kB/s)

Reading package lists… Done

Checking hardware requirements…

Checking for packages required for GPIO control…

Unicorn HAT/pHAT comes with examples and documentation that you may wish to
Performing a full install will ensure those resources are installed,
along with all required dependencies. It may however take a while!

Do you wish to perform a full install? [y/N] y
Checking install requirements…

Checking for dependencies…

Installing Unicorn HAT/pHAT library for Python 2…

Collecting unicornhat
Using cached unicornhat-2.1.2.tar.gz
Collecting rpi_ws281x>=2.0.0 (from unicornhat)
Using cached rpi_ws281x-2.0.3.tar.gz
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,
‘open’, open)(file);code=f.read().replace(’\r\n’,
’\n’);f.close();exec(compile(code, file, ‘exec’))” install --record
/tmp/pip-2Bca_9-record/install-record.txt --single-version-externally-managed
running install
running build
running build_py
Compiling ws281x library…
error: [Errno 2] No such file or directory


I looked into the issue and the problem is that Kano OS does not ship with a compiler.

you should be able to move forward by running:

sudo apt-get install build-essential

but PLEASE logout of the root account, it is NOT necessary to do 99.999999% of the things you’d likely need to do regardless of what you are trying to achieve, and carry a risk disproportional compared to the convenience of not typing sudo where appropriate, as and when required.

Good luck!


It worked…Thank You