Displayotron not loading advanced examples (Fixed)

I was excited to see that the DisplayoTron hat came with code that would allow me to create a radio and have information displayed on the LCD. However, after loading the libraries with the "Curl -sS get.pimoroni.com/displayotron |bash command, I’m not able to get the radio to work? I’m using sudo ./radio.py from the ~/Pimoroni/displayotron/examples/dothat/advanced library and receive the following error:

Traceback (most recent call last): File “./radio.py”, line 11, in from plugins.clock import Clock ImportError: No module name plugins.clock

Is there anyway to fix this? The main reason I purchased the Displayotron was to have the radio. I’m just starting out with Python, so I may have done something wrong as well.

Any help would be greatly appreciated.

— Also, I’m not able to run the game.py demo either. Same error… missing a plugin.

You’ll want to type: sudo python radio.py to run the script, and check that the examples/plugins/ folder exists.

Hope that helps.

The plugins are there, but it doesn’t seem like the script is finding them. The path to the script is: ~/Pimoroni/displayotron/examples/dothat/advanced/ and the path to the plugin folder is higher up in the directory at: ~/Pimoroni/displayotron/examples/plugins/

I’m really new to Python, so I’m not sure how to have the script find the plugins when they’re outside the programs directory.

I appreciate your help…

From looking at the radio script it sets things up so it should be able to find them. Are you definitely running the script with sudo python radio.py and not sudo radio.py as mentioned in the first post?

Yes, I’ve tried both ways (Sudo ./radio.py from Pimoroni’s tutorial) and the Sudo python radio.py you suggested. Both give me the same error.

I’m able to run all the demo scripts in the tohat directory except those that are dependent on the plugin folder. Game.py, Radio.py etc. elicit an error.

You could always move the plugin directory to the same level as the radio script?

1 Like

Thanks for your help!

After copying over the plugin folder, everything works well now. Thanks for the help…

1 Like

Good to hear, when I have a chance I might have an investigate as to why the plugins didn’t work, though I don’t own a DOT HAT.

I’ve been keeping my eye on this thread, but @major_tomm has beaten me to every reply ;)

I’ve made a mental (and digital) note to look into this.

For the record, what version of Raspbian/OS are you running @Tikishark?

Useful info can be gleaned with:

python --version
cat /etc/os-release
uname -a
1 Like

Okay, we got to the bottom of it!

The sys.path.append('../../') line was after the plugin imports, which basically means it wasn’t having any effect!

It was fixed in a more recent commit, but our installer was set up to play it safe and copy the examples corresponding to the last release. It’s fixed now!

2 Likes

I’m really sorry for the late response. I couldn’t get back to my computer until today.

I’m running the April 2017 version of Rasbian.

I really appreciate all the work you put into solving this problem… and as a plus, I learned about the sys.append statement.

Thanks again…

John

1 Like

No worries! You’re totally welcome.