Dotstar Library, won't run in python3

EL Wire/Tape/Panels, LEDs, pixels and strips, LCDs and TFTs, etc products from Adafruit

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
lwilkovich
 
Posts: 3
Joined: Sun Jul 30, 2017 5:39 am

Dotstar Library, won't run in python3

Post by lwilkovich »

Code: Select all

Traceback (most recent call last):
  File "strandtest.py", line 4, in <module>
    from dotstar import Adafruit_DotStar
ImportError: /home/logan/Programming/DotStarDev/dotstar.so: undefined symbol: Py_InitModule4_64
The code runs fine in python 2.7.12, but i can't figure this out when i try to run it in python 3.5.2

User avatar
adafruit_support_carter
 
Posts: 29483
Joined: Tue Nov 29, 2016 2:45 pm

Re: Dotstar Library, won't run in python3

Post by adafruit_support_carter »

I'll ask, but I'm guessing that one is probably Python 2 only.
https://github.com/adafruit/Adafruit_Do ... star.c#L57

User avatar
adafruit2
 
Posts: 22200
Joined: Fri Mar 11, 2005 7:36 pm

Re: Dotstar Library, won't run in python3

Post by adafruit2 »

yah its python 2 only - we're not sure how to make it py 3 compatible, if you figure it out please let us know :)

User avatar
Arudinne
 
Posts: 304
Joined: Sun Mar 19, 2017 9:36 pm

Re: Dotstar Library, won't run in python3

Post by Arudinne »

If you want to use Python 3, you might want to checkout BiblioPixel: https://github.com/ManiacalLabs/BiblioPixel

User avatar
benforta
 
Posts: 37
Joined: Wed Dec 25, 2013 10:34 am

Re: Dotstar Library, won't run in python3

Post by benforta »

adafruit2 wrote:yah its python 2 only
Any progress on a Python3 version of the library?

--- Ben

User avatar
adafruit2
 
Posts: 22200
Joined: Fri Mar 11, 2005 7:36 pm

Re: Dotstar Library, won't run in python3

Post by adafruit2 »

nope, no ETA - if someone manages to figure it out please send a Pull Request, and we'll merge it in!

User avatar
benforta
 
Posts: 37
Joined: Wed Dec 25, 2013 10:34 am

Re: Dotstar Library, won't run in python3

Post by benforta »

I don't see anything in there that shuld preclude it from working in Python 3, although the C code is explicitly loading the 2.7 version of Python.h. I'll see if I can get some time to tinker with it next week.

User avatar
velotron
 
Posts: 1
Joined: Thu Feb 20, 2014 4:09 pm

Re: Dotstar Library, won't run in python3

Post by velotron »

There is a patch posted at https://github.com/adafruit/Adafruit_Do ... -406747387 which worked for me. The patch assumes Python 3.5, but with minor changes it worked with 3.4 which I have on my Pi.

The sample scripts worked great with Python 3.

Locked
Please be positive and constructive with your questions and comments.

Return to “Glowy things (LCD, LED, TFT, EL) purchased at Adafruit”