VL534CD example python from website does not work on Raspberry PI

I am running on a Raspberry pi. i2cdetect does not detect the sensor but i am sure the wiring is correct, and when I connect it to an arduino it works.

I tried running your Example1-ReadDistance.py program but it gives this error

Installing collected packages: sparkfun-qwiic

Successfully installed sparkfun-qwiic-1.1.7

root@raspberrypi:/PMX/SparkFun_Qwiic_Distance_Sensor-VL53L4CD/Qwiic_VL53L1X_Py/examples# !py

python Example1_ReadDistance.py

The qwiic drivers are not installed - please check your installation

VL53L1X Qwiic Test

Traceback (most recent call last):

File “/PMX/SparkFun_Qwiic_Distance_Sensor-VL53L4CD/Qwiic_VL53L1X_Py/examples/Example1_ReadDistance.py”, line 61, in

ToF = qwiic.QwiicVL53L1X()

AttributeError: module ‘qwiic’ has no attribute ‘QwiicVL53L1X’

root@raspberrypi:/PMX/SparkFun_Qwiic_Distance_Sensor-VL53L4CD/Qwiic_VL53L1X_Py/examples#

This is annoying to debug as the sensor i bough is a V:534LCD yet the sample code from your site references a different sensor name, and even the name it is referencing does not work… please help

It looks like there’s a workaround described @ the end of this thread https://github.com/sparkfun/Qwiic_VL53L1X_Py/issues/7

That thread only makes it clear that there are errors in the source code that have existed for 2 1/2 years. Hard to work on a board when the provided examples dont work. Here is my console – How about you respond quickly to this request and get the source code posted on your production website fixed asap

import sparkfun_qwiic_vl53l1x

cat Example1.py

import sparkfun_qwiic_vl53l1x

import time

print(“VL53L1X Qwiic Test\n”)

ToF = qwiic.QwiicVL53L1X()

if (ToF.sensor_init() == None): # Begin returns 0 on a good init

print(“Sensor online!\n”)

while True:

try:

ToF.start_ranging() # Write configuration bytes to in\

itiate measurement

time.sleep(.005)

distance = ToF.get_distance() # Get the result of the measurement from the sensor

time.sleep(.005)

ToF.stop_ranging()

distanceInches = distance / 25.4

distanceFeet = distanceInches / 12.0

print(“Distance(mm): %s Distance(ft): %s” % (distance, distanceFeet))

except Exception as e:

print(e)

root@raspberrypi:/PMX# pip3 list | grep vl53

sparkfun-qwiic-vl53l1x 1.0.1

root@raspberrypi:/PMX# !py

python Example1.py

Traceback (most recent call last):

File “Example1.py”, line 57, in

import sparkfun_qwiic_vl53l1x

ImportError: No module named sparkfun_qwiic_vl53l1x

Lastest console trace

ls /usr/local/lib/python3.7/dist-packages | grep vl53l1x

qwiic_vl53l1x.py

sparkfun_qwiic_vl53l1x-1.0.1.dist-info

root@raspberrypi:/PMX#pip3 list | grep vl53l1x

^Croot@raspberrypi:/PMX# root@raspberrypi:/PMX#

root@raspberrypi:/PMX# !ls

ls /usr/local/lib/python3.7/dist-packages | grep vl53l1x

qwiic_vl53l1x.py

sparkfun_qwiic_vl53l1x-1.0.1.dist-info

root@raspberrypi:/PMX# root@raspberrypi:/PMX# pip3 list | grep vl53l1x

sparkfun-qwiic-vl53l1x 1.0.1

root@raspberrypi:/PMX# echo $PYTHONPATH

/usr/local/lib/python3.7/dist-packages:

root@raspberrypi:/PMX# grep import Example1.py

grep import Example1.py

import spark_funqwiic_vl53l1x

import time

root@raspberrypi:/PMX# python3.7 Example1.py

Traceback (most recent call last):

File “Example1.py”, line 62, in

import spark_funqwiic_vl53l1x

ModuleNotFoundError: No module named ‘spark_funqwiic_vl53l1x’