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

One question, after installing incl. the animations (pip install https://github.com/ManiacalLabs/BiblioPixelAnimations/archive/master.zip --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...

Script:
Code:
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)

try:
    anim = LarsonScanner(led, colors.Red, tail=6)
    anim.run(amt=1, fps=20, max_steps=50)
    anim = StripChannelTest(led)
    anim.run(fps=30)
except KeyboardInterrupt:
    led.all_off()
    led.update()

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

Thanks
#2
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?
#3
Code:
root@Testing:~/BiblioPixel# python test.py
['/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:
Code:
root@Testing:~/BiblioPixel# uname -a
Linux Testing 4.1.7+ #817 PREEMPT Sat Sep 19 15:25:36 BST 2015 armv6l GNU/Linux
#4
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.
#5
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
BiblioPixel==2.0.5
BiblioPixelAnimations===fdfdadc1cd19229668af07baa63cc89b0f0ab224
PixelWeb==1.0b8
#6
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.
#7
oh - could be so simple.

Is working now ;-)

Thanks.


Forum Jump:


Users browsing this thread: 1 Guest(s)