# Cannot import Explorerhat pro

**URL:** <https://forums.pimoroni.com/t/cannot-import-explorerhat-pro/897>\
**Category:** Support\
**Created:** [August 26, 2015, 9:36am UTC](https://forums.pimoroni.com/t/cannot-import-explorerhat-pro/897 "2015-08-26T09:36:47Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Greg1978](https://avatars.discourse-cdn.com/v4/letter/g/bcef8e/32.png) [@Greg1978](https://forums.pimoroni.com/u/Greg1978)\
**Post date:** [August 26, 2015, 9:36am UTC](https://forums.pimoroni.com/t/cannot-import-explorerhat-pro/897/1 "2015-08-26T09:36:47Z")

</div>

Hi, thanks for any help in advance - go easy I`m new to RPi and Linux in general

I have seen other people with the exact same problem but have never seen a solution on a forum so far

I can turn on the 4 leds and make them flash on the explorerhat, but when I came to set the outputs it wouldn`t work. I quickly realised I needed to do some things first to import explorer hat into python, but whatever instructionsI follow, it seems that I can never find i2c, although it is supposed to be ready.

using:

sudo i2cdetect -y 1

it just shows a message like Error: Could not open file /dev/i2c-1’ or/dev/i2c/1’: No such file or directory

I tried to enable i2c using raspi-config and it appears to work.

I have done:

curl [get.pimoroni.com/i2c](http://get.pimoroni.com/i2c) | bash  
sudo apt-get install python-smbus  
sudo apt-get install python-pip  
sudo pip install explorerhat

everything appears to be ok but trying to imprt explorerhat brings up

Traceback (most recent call last):  
File “”, line 1, in  
File “/usr/local/lib/python2.7/dist-packages/explorerhat.py”, line 624, in  
\_cap1208 = captouch.Cap1208()  
File “/usr/local/lib/python2.7/dist-packages/captouch.py”, line 187, in init  
self.i2c = SMBus(i2c\_bus)  
IOError: [Errno 2] No such file or directory

I have disabled device tree I think,

device-tree=

in config.txt I have  
dtparam=i2c\_arm=on

in /etc/modules I have  
i2c-dev  
i2c-bcm2708

lsmod shows  
Module Size Used by  
i2c\_dev 6027 0  
i2c\_bcm2708 4990 0

whatever I do there is never i2c in dev.

Sorry for lack of clarity or any ridiculous noob errors, but this is my first day with the RPi I am an absolute beginner.

Thanks.

G.

---

<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:** [August 26, 2015, 9:52am UTC](https://forums.pimoroni.com/t/cannot-import-explorerhat-pro/897/2 "2015-08-26T09:52:21Z")

</div>

This is another one of those instances of Raspbian just not wanting to enable I2C that I’ve never managed to diagnose. Have you tried a fresh reinstall of Raspbian to see if it fares any better?

It looks like you’ve tried basically everything else, do you see any devices when you:

`ls /dev/i2c*`

---

<div class="post-metadata">

**Author:** ![Greg1978](https://avatars.discourse-cdn.com/v4/letter/g/bcef8e/32.png) [@Greg1978](https://forums.pimoroni.com/u/Greg1978)\
**Post date:** [August 26, 2015, 10:01am UTC](https://forums.pimoroni.com/t/cannot-import-explorerhat-pro/897/3 "2015-08-26T10:01:27Z")

</div>

Hi, thanks for the help.

ls /dev/i2c\*

it say something like

cannot access /dev/i2c\*: No such file or directory

this is despite everything seeming to work properly up to this point.

If I can`t enable i2c, does this restrict me from using all the lovely HATs that are available?

I find it strange that I can still make the 4 LEDs on the explorer pro turn on or flash using python without importing explorerhat.

I have not tried a fresh install of Raspbian yet no - it was a pre-installed versionon the SD card, should I just download a new copy from somewhere and try that?

---

<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:** [August 26, 2015, 10:21am UTC](https://forums.pimoroni.com/t/cannot-import-explorerhat-pro/897/4 "2015-08-26T10:21:38Z")

</div>

The LEDs on Explorer Pro are just connected to regular GPIO pins- so they’re easy enough to control without the library itself.

Before doing a full reinstall, have you tried also updating your Raspbian card to the latest version? You can do this by running:

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

```

And then rebooting- this will take a while!

If all else fails, to reinstall Raspbian grab the image from here: [https://www.raspberrypi.org/downloads/raspbian/](https://www.raspberrypi.org/downloads/raspbian/)

And follow the steps here that are relevant to your desktop/laptop operating system: [https://www.raspberrypi.org/documentation/installation/installing-images/README.md](https://www.raspberrypi.org/documentation/installation/installing-images/README.md)

---

<div class="post-metadata">

**Author:** ![Greg1978](https://avatars.discourse-cdn.com/v4/letter/g/bcef8e/32.png) [@Greg1978](https://forums.pimoroni.com/u/Greg1978)\
**Post date:** [August 26, 2015, 10:25am UTC](https://forums.pimoroni.com/t/cannot-import-explorerhat-pro/897/5 "2015-08-26T10:25:31Z")

</div>

Thanks so much for your help, I will try this next chance I get to have a play.

---

<div class="post-metadata">

**Author:** ![tvoverbeek](https://avatars.discourse-cdn.com/v4/letter/t/f08c70/32.png) [@tvoverbeek](https://forums.pimoroni.com/u/tvoverbeek)\
**Post date:** [August 27, 2015, 11:59am UTC](https://forums.pimoroni.com/t/cannot-import-explorerhat-pro/897/6 "2015-08-27T11:59:00Z")

</div>

Remove the ‘dtparam=’ from config.txt (in other words enable device tree)  
The dtparam=i2c\_arm=on should then load the i2c-bcm2708 module and enable i2c at boot.  
To get the /dev/i2c\* entry you will still have to load the i2c-dev module.  
You already have i2c-dev in /etc/modules.  
Make sure i2c-dev is **not** in the blacklist (file /etc/modprobe.d/raspi-blacklist.conf).  
If not loaded, you can still load it manually: ‘sudo modprobe i2c-dev’.
