# Install of Blinkt software fails ... python.h not found

**URL:** <https://forums.pimoroni.com/t/install-of-blinkt-software-fails-python-h-not-found/2960>\
**Category:** Support\
**Created:** [September 2, 2016, 2:37pm UTC](https://forums.pimoroni.com/t/install-of-blinkt-software-fails-python-h-not-found/2960 "2016-09-02T14:37:24Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![normandevaux](https://avatars.discourse-cdn.com/v4/letter/n/e480ec/32.png) [@normandevaux](https://forums.pimoroni.com/u/normandevaux)\
**Post date:** [September 2, 2016, 2:37pm UTC](https://forums.pimoroni.com/t/install-of-blinkt-software-fails-python-h-not-found/2960/1 "2016-09-02T14:37:24Z")

</div>

I am running…

```
 curl -sS get.pimoroni.com/blinkt | bash

```

on one of my Pi 3s to install the Blinkt module and sample code, but it keeps failing at this point…

Installing collected packages: blinkt, RPi.GPIO  
Running [setup.py](http://setup.py) install for blinkt

Running [setup.py](http://setup.py) install for RPi.GPIO  
building ‘RPi.\_GPIO’ 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 -I/usr/include/python2.7 -c source/py\_gpio.c -o build/temp.linux-armv7l-2.7/source/py\_gpio.o  
source/py\_gpio.c:23: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-ajcxm8/RPi.GPIO/setup.py’;exec(compile(getattr(tokenize, ‘open’, open)( **file** ).read().replace(’\r\n’, ‘\n’), **file** , ‘exec’))” install --record /tmp/pip-Tv1PxQ-record/install-record.txt --single-version-externally-

I installed the Blinkt module and samples successfully a few weeks ago on my Pi Zero, so I know it has been working ok.

Any pointers? I have already done

sudo apt-get update  
sudo apt-get upgrade

but they do not fix it.

I have the latest version of Jessie with full GUI, i.e., not Jessie Lite, on both of the Pis.

Thanks,  
Norm

---

<div class="post-metadata">

**Author:** ![normandevaux](https://avatars.discourse-cdn.com/v4/letter/n/e480ec/32.png) [@normandevaux](https://forums.pimoroni.com/u/normandevaux)\
**Post date:** [September 2, 2016, 2:58pm UTC](https://forums.pimoroni.com/t/install-of-blinkt-software-fails-python-h-not-found/2960/2 "2016-09-02T14:58:33Z")

</div>

I have tried the same command on another Pi3 and it fails in exactly the same place with the same error message.

---

<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:** [September 2, 2016, 3:21pm UTC](https://forums.pimoroni.com/t/install-of-blinkt-software-fails-python-h-not-found/2960/3 "2016-09-02T15:21:55Z")

</div>

A fix for this went live a few minutes ago, give it another try when you get a chance!

---

<div class="post-metadata">

**Author:** ![normandevaux](https://avatars.discourse-cdn.com/v4/letter/n/e480ec/32.png) [@normandevaux](https://forums.pimoroni.com/u/normandevaux)\
**Post date:** [September 2, 2016, 11:59pm UTC](https://forums.pimoroni.com/t/install-of-blinkt-software-fails-python-h-not-found/2960/4 "2016-09-02T23:59:05Z")

</div>

Yep. Thanks. I ‘discovered’ the fix before I read your reply LOL.

I love my little Blinkts!!! I now have 4, one for each Pi. The Pis are calculating Gaussian primes and are now out to 100 billion units from the origin of the complex plane. I use the Blinkts to display every 1,000th prime they find by scrolling the numbers as individual LEDs - one for each digit - using a different colour for each (1=red, 2=green, 3=1+2=red+green, etc).

It has to be every thousandth prime because even the Pi zero calculates them so fast, that they overlap when scrolling, if I have it more frequently. As it is, they’re about every 40 seconds.

I put the code up on GitHub in case anyone is interested. The Python routine is called using a system( … ) call from with my C program that is doing the actual prime calculations.

---

<div class="post-metadata">

**Author:** ![jonwitts](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/jonwitts/32/1695_2.png) [@jonwitts](https://forums.pimoroni.com/u/jonwitts)\
**Post date:** [October 31, 2016, 6:33am UTC](https://forums.pimoroni.com/t/install-of-blinkt-software-fails-python-h-not-found/2960/5 "2016-10-31T06:33:50Z")

</div>

I realise that this is a somewhat older post and you have said that a fix went out for this; but I am seeing the same error today trying to install the Blinkt! libraries.

Any help gratefully received!

The detail from the pip log file shows this:

* * *

Found existing installation: RPi.GPIO 0.6.2  
Not uninstalling RPi.GPIO at /usr/lib/python2.7/dist-packages, owned by OS  
Running [setup.py](http://setup.py) install for RPi.GPIO  
Running command /usr/bin/python -c “import setuptools, tokenize; **file** =’/tmp/pip-build-KqESVx/RPi.GPIO/setup.py’;exec(compile(getattr(  
tokenize, ‘open’, open)( **file** ).read().replace(’\r\n’, ‘\n’), **file** , ‘exec’))” install --record /tmp/pip-T9yzNF-record/install-record.t  
xt --single-version-externally-managed --compile  
running install  
running build  
running build\_py  
creating build  
creating build/lib.linux-armv6l-2.7  
creating build/lib.linux-armv6l-2.7/RPi  
copying RPi/ **init**.py -\> build/lib.linux-armv6l-2.7/RPi  
creating build/lib.linux-armv6l-2.7/RPi/GPIO  
copying RPi/GPIO/ **init**.py -\> build/lib.linux-armv6l-2.7/RPi/GPIO  
running build\_ext  
building ‘RPi.\_GPIO’ extension  
creating build/temp.linux-armv6l-2.7  
creating build/temp.linux-armv6l-2.7/source  
arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -D\_FORTIFY\_SOURCE=2 -g -fstack-p  
rotector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c source/py\_gpio.c -o build/temp.linux-armv6l-2.7/source/py  
\_gpio.o  
source/py\_gpio.c:23: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-KqESVx/RPi.GPIO/setup.py’;exec(com  
pile(getattr(tokenize, ‘open’, open)( **file** ).read().replace(’\r\n’, ‘\n’), **file** , ‘exec’))” install --record /tmp/pip-T9yzNF-record/ins  
tall-record.txt --single-version-externally-managed --compile:  
running install

running build

running build\_py

creating build

creating build/lib.linux-armv6l-2.7

creating build/lib.linux-armv6l-2.7/RPi

copying RPi/ **init**.py -\> build/lib.linux-armv6l-2.7/RPi

creating build/lib.linux-armv6l-2.7/RPi/GPIO

copying RPi/GPIO/ **init**.py -\> build/lib.linux-armv6l-2.7/RPi/GPIO

running build\_ext

building ‘RPi.\_GPIO’ extension

creating build/temp.linux-armv6l-2.7

creating build/temp.linux-armv6l-2.7/source

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 -I/usr/include/python2.7 -c source/py\_gpio.c -o build/temp.linux-armv6l-2.7/source/py\_gpio.o

source/py\_gpio.c:23: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

* * *

Can’t roll back RPi.GPIO; was not uninstalled

---

<div class="post-metadata">

**Author:** ![JulianNicholls](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/juliannicholls/32/557_2.png) [@JulianNicholls](https://forums.pimoroni.com/u/JulianNicholls)\
**Post date:** [October 31, 2016, 10:53am UTC](https://forums.pimoroni.com/t/install-of-blinkt-software-fails-python-h-not-found/2960/6 "2016-10-31T10:53:40Z")

</div>

`sudo apt-get install python-dev`

before running the Blinkt! install script will probably fix it.

---

<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:** [October 31, 2016, 1:37pm UTC](https://forums.pimoroni.com/t/install-of-blinkt-software-fails-python-h-not-found/2960/7 "2016-10-31T13:37:19Z")

</div>

actually, an easier solution is to run:

```
sudo apt-get install python-rpi.gpio python3-rpi.gpio

```

this will roll the new version of RPi.GPIO released last night from the apt-repo and avoid pip unhelpfully trying to compile it from source.

We are working on a solution for the install script not to fall over in this peculiar scenario (of RPi.GPIO being updated, however infrequently), but in the meantime this should do it, without installing python headers to satisfy the compilation.

---

<div class="post-metadata">

**Author:** ![jonwitts](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/jonwitts/32/1695_2.png) [@jonwitts](https://forums.pimoroni.com/u/jonwitts)\
**Post date:** [October 31, 2016, 1:54pm UTC](https://forums.pimoroni.com/t/install-of-blinkt-software-fails-python-h-not-found/2960/8 "2016-10-31T13:54:25Z")

</div>

That didn’t seem to work for me…

I tried the install of python-rpi-gpio and python3-rpi.gpio and was told that there were both already at the latest version. Then rerunning the Blinkt! install script gives me the same error…

Just trying a full apt-get update and upgrade then will post back…

---

<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:** [October 31, 2016, 2:37pm UTC](https://forums.pimoroni.com/t/install-of-blinkt-software-fails-python-h-not-found/2960/9 "2016-10-31T14:37:51Z")

</div>

strange, it worked for me here. We are in the process of hosting our libs in the Raspbian repo, so hopefully all this pip non-sense is not something you’ll have to put up with for much longer.

in the meantime, if a fully updated Raspbian still gives you trouble, then try @JulianNicholls’s solution. It is heavy handed in the sense that compiling from source is unnecessary, but it should shut up pip once and for all!

---

<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:** [October 31, 2016, 2:39pm UTC](https://forums.pimoroni.com/t/install-of-blinkt-software-fails-python-h-not-found/2960/10 "2016-10-31T14:39:29Z")

</div>

err, you’re not on Wheezy by any chance right? if so then it’s unlikely the latest rpi.gpio packages have been pushed to that repo.

---

<div class="post-metadata">

**Author:** ![jonwitts](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/jonwitts/32/1695_2.png) [@jonwitts](https://forums.pimoroni.com/u/jonwitts)\
**Post date:** [October 31, 2016, 4:51pm UTC](https://forums.pimoroni.com/t/install-of-blinkt-software-fails-python-h-not-found/2960/11 "2016-10-31T16:51:09Z")

</div>

Sorry, should have said… latest Jessie image here…

Copied from the terminal…

```
pi@raspberrypi:~ $ sudo apt-get install python-rpi.gpio python3-rpi.gpio
Reading package lists... Done
Building dependency tree       
Reading state information... Done
python-rpi.gpio is already the newest version.
python3-rpi.gpio is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
pi@raspberrypi:~ $ curl -sS get.pimoroni.com/blinkt | bash

```

Which then gives me this…

```
Installing Blinkt! library for Python 2...

Requirement already up-to-date: blinkt in /usr/local/lib/python2.7/dist-packages
Requirement already up-to-date: RPi.GPIO in /usr/lib/python2.7/dist-packages (from blinkt)
Cleaning up...

Installing Blinkt! library for Python 3...

Requirement already up-to-date: blinkt in /usr/local/lib/python3.4/dist-packages
Requirement already up-to-date: RPi.GPIO in /usr/lib/python3/dist-packages (from blinkt)
Cleaning up...

Checking for additional software...

python-numpy is already installed
python-psutil is already installed
python-requests is already installed
python-tweepy is required
python3-numpy is already installed
python3-psutil is already installed
python3-requests is already installed

python-numpy is already installed
python-psutil is already installed
python-requests is already installed
python-tweepy is required
Installing python-tweepy...

python3-numpy is already installed
python3-psutil is already installed
python3-requests is already installed

Downloading examples and documentation...

Cloning into 'blinkt'...
remote: Counting objects: 78, done.
remote: Compressing objects: 100% (70/70), done.
remote: Total 78 (delta 5), reused 34 (delta 1), pack-reused 0
Unpacking objects: 100% (78/78), done.
Checking connectivity... done.

Resources for your Blinkt! were copied to
/home/pi/Pimoroni/blinkt

All done!

Enjoy your Blinkt!!

```

Happy days! Guess the apt-get update sorted it for me!

Time to start playing with my Blinkt!

Thanks for everyone’s help.

Jon

---

<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:** [October 31, 2016, 6:53pm UTC](https://forums.pimoroni.com/t/install-of-blinkt-software-fails-python-h-not-found/2960/12 "2016-10-31T18:53:09Z")

</div>

We rushed out a fix for the script, so could be that too. Either way, enjoy your blinkt!
