sparkfun / Qwiic_KX13X_Py

MIT License
0 stars 3 forks source link

import error with raspberry pi #5

Closed alihanks closed 2 days ago

alihanks commented 1 year ago

I am trying to use this software to interface with the sparkfun triple axis accelerometer breakout. I am using a python 3b+ with the bullseye Raspian OS and python 3.9. The error I'm getting is:

import qwiic_kx13x Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/local/lib/python3.9/dist-packages/qwiic_kx13x.py", line 334 """ ^ SyntaxError: (unicode error) 'utf-8' codec can't decode byte 0xa0 in position 173: invalid start byte I have also gotten the same error using an older Raspian OS and python 3.5.

hernandezurbina commented 1 year ago

is this solved? I'm getting the same error on a Raspberry Pi 4 using a servo phat to connect the qwiic accelerometer. I'm using python 3.7.

greg-jc commented 1 year ago

Has this been solved yet? I am using the Triple Axis Accelerometer Breakout - KX132 on a Raspberry Pi 4B connected with the Sparkfun Raspberry Pi Qwiic SHIM. Raspberry Pi OS and Python version 3.9.2. It gives me the same error.

Aser-Abdelfatah commented 5 days ago

I'm getting same error with Nvidia Jetbot

sfe-SparkFro commented 2 days ago

Hi folks, sorry for the delay on this fix! I had the same problem. Looks like there was a weird character in the comment block that caused this, so I just removed that and it imports fine on my end now.

Aser-Abdelfatah commented 2 days ago

Now, I get a different error: Invalid driver class name. Unable to locate QwiicKx13X

sfe-SparkFro commented 1 day ago

Good catch! I also get this when calling import qwiic, as indicated by your issue in Qwiic_Py. import qwiic_kx13x seems to work fine, so you can use that as a workaround until that gets fixed.