As indicated, best to try and get it to work in the context of a Virtual Environment. I was able to get the following done but don't know if it will work because I don't have the sensor. Based on instructions from https://pypi.org/project/VL53L1X/
Code:
pi@wethCAM:~ $ mkdir my_venvpi@wethCAM:~ $ python -m venv my_venvpi@wethCAM:~ $ source my_venv/bin/activate(my_venv) pi@wethCAM:~ $ pip install smbus2Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simpleCollecting smbus2 Using cached https://www.piwheels.org/simple/smbus2/smbus2-0.5.0-py2.py3-none-any.whl (11 kB)Installing collected packages: smbus2Successfully installed smbus2-0.5.0(my_venv) pi@wethCAM:~ $ pip install vl53l1xLooking in indexes: https://pypi.org/simple, https://www.piwheels.org/simpleCollecting vl53l1x Downloading VL53L1X-0.0.5.tar.gz (182 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 182.3/182.3 kB 432.9 kB/s eta 0:00:00 Preparing metadata (setup.py) ... doneRequirement already satisfied: smbus2 in ./my_venv/lib/python3.11/site-packages (from vl53l1x) (0.5.0)Installing collected packages: vl53l1x DEPRECATION: vl53l1x is being installed using the legacy 'setup.py install' method, because it does not have a 'pyproject.toml' and the 'wheel' package is not installed. pip 23.1 will enforce this behaviour change. A possible replacement is to enable the '--use-pep517' option. Discussion can be found at https://github.com/pypa/pip/issues/8559 Running setup.py install for vl53l1x ... doneSuccessfully installed vl53l1x-0.0.5(my_venv) pi@wethCAM:~ $ pythonPython 3.11.2 (main, Nov 30 2024, 21:22:50) [GCC 12.2.0] on linuxType "help", "copyright", "credits" or "license" for more information.>>> import VL53L1X>>> dir(VL53L1X)['CDLL', 'CFUNCTYPE', 'POINTER', 'SMBus', 'VL53L1X', 'VL53L1xDistanceMode', 'VL53L1xError', 'VL53L1xUserRoi', '_I2C_MULTI_FUNC', '_I2C_READ_FUNC', '_I2C_WRITE_FUNC', '_POSSIBLE_LIBRARY_LOCATIONS', '_TOF_LIBRARY', '__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__spec__', 'c_int', 'c_ubyte', 'c_uint', 'c_uint32', 'c_uint8', 'files', 'glob', 'i2c_msg', 'lib_file', 'lib_location', 'os', 'pointer', 'site']>>> exit()(my_venv) pi@wethCAM:~ $ Statistics: Posted by DS256 — Thu Jun 12, 2025 12:04 am