Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
include animations lib?
thanks for the great Bibliopixel ;-)

One question, after installing incl. the animations (pip install --upgrade) I can't access e.g. the LarsonScanner from the script.

On Raspberry Pi

What is wrong?

Info: PYTHONPATH is empty...
Info2: StripChannelTest is working...

from bibliopixel.drivers.visualizer import *
from bibliopixel.animation import *
from bibliopixel import *
from BiblioPixelAnimations.strip import LarsonScanners
import bibliopixel.colors as colors

driver = DriverVisualizer(num=25, pixelSize=20)
led = LEDStrip(driver)

    anim = LarsonScanner(led, colors.Red, tail=6), fps=20, max_steps=50)
    anim = StripChannelTest(led)
except KeyboardInterrupt:

root@Testing:~/BiblioPixel# python
Traceback (most recent call last):
  File "", line 13, in <module>
    anim = LarsonScanner(led, colors.Red, tail=6)
NameError: name 'LarsonScanner' is not defined

That should work....
In the python interpreter, run:

import sys
print sys.path

And send me the results.
What type of system are you running this on? Normal PC, Raspberry pi? What version of Linux?
root@Testing:~/BiblioPixel# python
['/root/BiblioPixel', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-linux2', '/usr/lib/python2.7/lib-tk', '/usr/lib/python2.7/lib-old', '/usr/lib/python2.7/lib-dynload', '/usr/local/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages/PIL', '/usr/lib/python2.7/dist-packages/gtk-2.0', '/usr/lib/pymodules/python2.7']

Rspberry Pi:
root@Testing:~/BiblioPixel# uname -a
Linux Testing 4.1.7+ #817 PREEMPT Sat Sep 19 15:25:36 BST 2015 armv6l GNU/Linux
Ok, it should have installed BiblioPixelAnimations to /usr/lib/python2.7/dist-packages
At the terminal, run:

ls -al /usr/lib/python2.7/dist-packages | grep ixel

You should see something like this:

d-rwxr-xr-x    3 root root   4096 Dec 17 08:06 bibliopixel
d-rwxr-xr-x    2 root root   4096 Dec 17 08:06 BiblioPixel-2.0.5-py2.7.egg-info
d-rwxr-xr-x    5 root root   4096 Dec 21 11:30 BiblioPixelAnimations
d-rwxr-xr-x    2 root root   4096 Dec 21 11:30 BiblioPixelAnimations-fdfdadc1cd19229668af07baa63cc89b0f0ab224-py2.7.egg-info
d-rwxr-xr-x    3 root root   4096 Dec 17 08:06 pixelweb
d-rwxr-xr-x    2 root root   4096 Dec 17 08:06 PixelWeb-1.0b8-py2.7.egg-info

Try the same for /usr/local/lib/python2.7/dist-packages if nothing in the other directory.

Also, please send me the results of: pip freeze | grep ixel

To explain the "grep ixel" thing...  BiblioPixel gets installed as bibliopixel, and grep is case sensitive so it was just my lazy way of searching for everything since that last part is always lowercase.
root@Testing:~/BiblioPixel# ls -al /usr/lib/python2.7/dist-packages | grep ixel

root@Testing:~/BiblioPixel# ls -al /usr/local/lib/python2.7/dist-packages | grep ixel
drwxr-sr-x 3 root staff 4096 Dec 29 13:40 bibliopixel
-rw-r--r-- 1 root staff 610 Dec 29 13:40 BiblioPixel-2.0.5.egg-info
drwxr-sr-x 5 root staff 4096 Jan 3 16:28 BiblioPixelAnimations
drwxr-sr-x 2 root staff 4096 Jan 3 16:28 BiblioPixelAnimations-fdfdadc1cd19229668af07baa63cc89b0f0ab224-py2.7.egg-info
drwxr-sr-x 3 root staff 4096 Jan 1 16:55 pixelweb
drwxr-sr-x 2 root staff 4096 Jan 1 16:55 PixelWeb-1.0b8.dist-info

root@Testing:~/BiblioPixel# pip freeze | grep ixel
Oh... duh. I just assumed it was an install issue. It's not... it's with your code.
Use this:
from BiblioPixelAnimations.strip.LarsonScanners import *

The way you did the import, you would've had to use:
anim = LarsonScanners.LarsonScanner(....)

Sorry for the confusion. The code looked close enough so I just went with it.
oh - could be so simple.

Is working now ;-)


Forum Jump:

Users browsing this thread: 1 Guest(s)