Having problems with Unicorn Paint (can't find paint.py?)


#1

I’ve just today set up my Unicorn pHAT and muddled my way through the Getting Started with unicorn pHAT tutorial just fine so had a quick snoop and figured I’d give the Getting started with Unicorn Paint tutorial a go but have had problems getting past the Start Unicorn Paint step:

"Before starting Unicorn Paint, you should make sure the dependencies are installed. Unicorn Paint requires the Python web framework Flask. To get it installed, just:

sudo pip install flask
Locate the code you downloaded earlier and make your way to the Unicorn Paint example folder. Then just type:

sudo ./paint.py
And Unicorn Paint should fire up on your Pi. Note: you won’t see any graphical interface yet, we need to connect with a web browser from another computer, or your Pi, to get things working."

I installed Flask without any trouble but when I navigate to /home/pi/Pimoroni/unicornhat there’s nothing there. As I understand it (probably incorrectly), there should be a unicornpaint folder in here containing paint.py somewhere but there’s just nothing. When I try to run “git clone https://github.com/pimoroni/unicornhat” in an attempt to download the example code I get :

pi@raspberrypi:~ git clone https://github.com/pimoroni/unicornhat Cloning into 'unicornhat'... fatal: Out of memory, malloc failed (tried to allocate 1048576000 bytes) pi@raspberrypi:~ fatal: Not a git repository: ‘/home/pi/unicornhat/.git’

Now, I am totally new to all of this so I’m assuming the problem here is most likely me doing something very simple, very wrong so what do I do?


#2

Unicorn paint does no currently seem to be part of the examples.

@gadgetoid where has it wandered of to?


#3

it’s inside the ‘hat’ directory?


#4

The reason I said it is not there is because it is not where the tutorial says you will find it.


#5

Thanks for your responses, I did a little digging and realised paint didn’t seem to be part of the examples (as pi2003 said), a few minutes before seeing your comments and was relieved to have it confirmed as I wasn’t sure if I was just being a bit dense.
I’ll have another go later now I know to find it elsewhere!
Thanks muchly!


#6

I’m still confised… what is the problem? I can see the paint.py file in the examples folder, within a ‘unicornpaint’ folder, itself within a ‘hat’ directory, and see no location specific command that would prevent following the tutorial?

either way, unless I misunderstand, AFAICT it has been pushed into subfolders within the examples folder since the tutorial was written, but contains no code that would be affected by a relative path change?


#7

Oh I see, I apologise, I misunderstood your comments. When I navigate into the unicornhat directory there is nothing in there at all, I have no examples folder as far as I can see. I may be just being a bit hopeless as I’m new to all of this but I did have a good look around and the only relevant thing I can find anywhere is a pimoroni directory containing an empty folder named unicornhat. I apologise if this is just me being absolutely stupid and looking in the wrong place as I’ve owned my Pi for a grand total of two weeks and my unicorn pHAT for just a few days and am still getting to grips with Linux nevermind anything else so I really am a bit baffled.
I fully expect this is entirely user error so please do tell me if I’m missing the obvious here…


#8

this is strange… not sure why the examples would refuse to copy, they do for me using the current install script.

I do see an error in the tutorial though - the correct command to clone the repository is:
git clone https://github.com/pimoroni/unicorn-hat
(note the dash before ‘hat’)

I’m going to have a look at restructuring the repository and check/make Unicorn Paint compatible with the pHAT in any case, though I think it will run currently although unoptimised in term of layout.


#9

I have now modified Unicorn Paint to support the pHAT… I also moved it to its own ‘projects’ folder, which is more in line with what we’ve done lately, with more interactive or complex examples. So, look for it in the new ‘projects’ folder.

… to get to it, you should be able to run the installer as specified in the tutorial, or git cloning the repo if needs be.

Note that the tutorial needs revision in respect to the location of paint.py but it should be the only thing not in line with the writing, I believe. If you see anything odd, please report here, we’ll be updating the tutorial in the next couple of days anyhow.


#10

Thanks very much for the updates, I’ll give this all another go later in the week and let you know if I run into any troubles!