ratbag3366
Posts: 6
Joined: Wed May 01, 2013 12:29 pm

PiFace Problem: "ImportError: No Module named piface.pfio"

Fri May 10, 2013 5:54 pm

I have installed the PiFace board but get "ImportError: No Module named piface.pfio" as an error when ever I try running my coded masterpieces in IDLE3.

However - running the emulator + canned test scripts works as does running my programmes after changing chown on my filename.py to root and running as sudo - which would indicate that the board and drivers are all ok.

It seems to be a permissions issue.

I have tried (three times now) doing a clean installation of Raspbian + updates and then installing the PiFace board as per the manufacturers instructions.

This ought to be simple but I just cannot get this to work properly.

I can confirm that PI is a member of the SPI user group.

Can anyone please help?

Update: If i write a .py program in vi (as pi user) and run 'python filename.py' as pi user the PiFace board works. If I try doing that in IDLE I get the error - it's as though IDLE doesn't know how to link to the PiFace libraries... Is this fixable?

JulianBR
Posts: 21
Joined: Mon Apr 22, 2013 8:42 pm

Re: PiFace Problem: "ImportError: No Module named piface.pfi

Mon May 13, 2013 9:26 pm

did you get anywhere with this as i have the exact same problems I suspect it has something to do with how i installed it ... via vnc .... i have retried installing it from the device itself but its still the same

regards

WebPi
Posts: 262
Joined: Wed Apr 10, 2013 6:47 pm
Location: Birmingham, UK
Contact: Website

Re: PiFace Problem: "ImportError: No Module named piface.pfi

Sat Jun 22, 2013 5:45 pm

I have exactly the same problem. The pi face emulator works and I can see LEDs turning on and off when I click on the emulator buttons, but that's it.

In python scripts I get the error mentioned in the OP. With wiringPi's GPIO utility nothing happens. I edited the raspi-blacklist.conf, downloaded the software, changed directory and ran setup.py install.

Has anyone else seen this?
raspberrywebserver.com - Raspberry Pi tutorials
LinuxWebServers.net - Linux Web Server tutorials and examples
pyplate.com - Python web publishing tool

ModifiedPi
Posts: 7
Joined: Wed Apr 24, 2013 6:26 am
Location: Preston, UK

Re: PiFace Problem: "ImportError: No Module named piface.pfi

Sat Jun 22, 2013 7:21 pm

Guys,

If you read the readme file in the Piface folder, you find this:

*The software in this repository uses Python 2 and is incompatible with Python 3*
Mark P

RPi Model B, CSI Camera Module, Pi-Face & More

WebPi
Posts: 262
Joined: Wed Apr 10, 2013 6:47 pm
Location: Birmingham, UK
Contact: Website

Re: PiFace Problem: "ImportError: No Module named piface.pfi

Sun Jun 23, 2013 4:19 pm

I'm using Python 2.7.3. I suspect that the Pi Face python module isn't being installed properly, but I'm not sure how to fix this.
raspberrywebserver.com - Raspberry Pi tutorials
LinuxWebServers.net - Linux Web Server tutorials and examples
pyplate.com - Python web publishing tool

WebPi
Posts: 262
Joined: Wed Apr 10, 2013 6:47 pm
Location: Birmingham, UK
Contact: Website

Re: PiFace Problem: "ImportError: No Module named piface.pfi

Wed Jun 26, 2013 11:14 am

I worked it out. The mistake I was making was calling my script piface.py. It turns out my script was importing itself. D'oh! I changed the name of the script, deleted piface.pyc from my home directory and everything worked.
raspberrywebserver.com - Raspberry Pi tutorials
LinuxWebServers.net - Linux Web Server tutorials and examples
pyplate.com - Python web publishing tool

bulletmark
Posts: 121
Joined: Wed Oct 17, 2012 10:10 pm
Location: Brisbane Australia

Re: PiFace Problem: "ImportError: No Module named piface.pfi

Wed Jun 26, 2013 11:50 pm

WebPi wrote:I worked it out. The mistake I was making was calling my script piface.py.
That is actually a common classic python mistake. One of us here should have thought of that!

Return to “General discussion”