Giga_Pi
Posts: 66
Joined: Mon May 20, 2019 9:48 am

inky phat library, need help!

Thu Feb 13, 2020 4:58 pm

Hello!

I recently got a inky pHAT from pimoroni, but when I try to run a test, I get:


Traceback (most recent call last):
File "/home/pi/inkytest.py, line 1, in <module>
from inky import InkyPHAT
ModuleNotFoundError: No module named ''inky'

I did install it using the instructions they provided, pip didn't produce any errors.

Help?

Thanks
As soon as the DM smiles, you know it's too late...

User avatar
B.Goode
Posts: 9602
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: inky phat library, need help!

Thu Feb 13, 2020 5:17 pm

How, exactly, did you install the library?

And how, exactly, do you try to run your sample script?


(I suspect an issue around versions of the Python interpreter.)

Giga_Pi
Posts: 66
Joined: Mon May 20, 2019 9:48 am

Re: inky phat library, need help!

Thu Feb 13, 2020 5:27 pm

sudo pip install inky

I then wrote a program:

from inky import InkyPHAT
inkyphat = InkyPHAT('red')
As soon as the DM smiles, you know it's too late...

User avatar
B.Goode
Posts: 9602
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: inky phat library, need help!

Thu Feb 13, 2020 5:30 pm

B.Goode wrote:
Thu Feb 13, 2020 5:17 pm
How, exactly, did you install the library?

And how, exactly, do you try to run your sample script?


(I suspect an issue around versions of the Python interpreter.)

Giga_Pi
Posts: 66
Joined: Mon May 20, 2019 9:48 am

Re: inky phat library, need help!

Thu Feb 13, 2020 5:46 pm

So what should I do?
As soon as the DM smiles, you know it's too late...

DirkS
Posts: 10206
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: inky phat library, need help!

Thu Feb 13, 2020 5:48 pm

Giga_Pi wrote:
Thu Feb 13, 2020 5:46 pm
So what should I do?
Tell us which version of Python you use to run your script...
You probably installed the module for Python v2

User avatar
B.Goode
Posts: 9602
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: inky phat library, need help!

Thu Feb 13, 2020 6:05 pm

Giga_Pi wrote:
Thu Feb 13, 2020 5:46 pm
So what should I do?


If you don't want to share the details of what you have done you could try both versions of the Python interpreter and compare the results?

Code: Select all

python inkytest.py

and

Code: Select all

python3 inkytest.py


(I would expect the first to succeed and the second to fail... )

pcmanbob
Posts: 8348
Joined: Fri May 31, 2013 9:28 pm
Location: Mansfield UK

Re: inky phat library, need help!

Thu Feb 13, 2020 6:39 pm

If you followed the install instructions on the github page then you only installed it for python2,

if you are using thonny they you will be using python 3,

So you need to install it for python 3

Code: Select all

sudo pip3 install inky
We want information… information… information........................no information no help
The use of crystal balls & mind reading are not supported

DirkS
Posts: 10206
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: inky phat library, need help!

Thu Feb 13, 2020 7:21 pm

pcmanbob wrote:
Thu Feb 13, 2020 6:39 pm
So you need to install it for python 3
That's assuming OP runs Python 3 *and* that pip links to the v2 version

pcmanbob
Posts: 8348
Joined: Fri May 31, 2013 9:28 pm
Location: Mansfield UK

Re: inky phat library, need help!

Thu Feb 13, 2020 7:31 pm

DirkS wrote:
Thu Feb 13, 2020 7:21 pm
pcmanbob wrote:
Thu Feb 13, 2020 6:39 pm
So you need to install it for python 3
That's assuming OP runs Python 3 *and* that pip links to the v2 version
I followed the link to the later version from the pimoroni product page , it only shows the install for python 2 which is why I suggested installing for python 3.
We want information… information… information........................no information no help
The use of crystal balls & mind reading are not supported

Giga_Pi
Posts: 66
Joined: Mon May 20, 2019 9:48 am

Re: inky phat library, need help!

Fri Feb 14, 2020 9:08 am

Right, will get back when I can.

Will do all suggested.

I'll be back. :twisted:

Oh yeah, I did:

pip install inky

for clarification.
As soon as the DM smiles, you know it's too late...

Giga_Pi
Posts: 66
Joined: Mon May 20, 2019 9:48 am

Re: inky phat library, need help!

Sun Feb 16, 2020 5:03 pm

Did as was suggested, and installed with
pip3 install inky

Worked first time.

Thanks all!
As soon as the DM smiles, you know it's too late...

Return to “Python”