Skip to content

"sys.path.insert" error #19

Description

@texx00

I tried to load the library by using sys.path.insert but there was an error at runtime:
File "main.py", line 6, in <module> import VL53L0X
File "/home/pi/*MyPath*/lib/VL53L0X_rasp_python/python/VL53L0X.py", line 68, in <module> tof_lib = CDLL("../bin/vl53l0x_python.so")
File "/usr/lib/python3.5/ctypes/__init__.py", line 347, in __init__ self._handle = _dlopen(self._name, mode)
OSError: ../bin/vl53l0x_python.so: cannot open shared object file: No such file or directory

I tried to add the path to the libraries environment variable and other things but I was not able to fix it.

I did find a workaround by changing the VL53L0X.py library file like this on line 67:
# Load VL53L0X shared lib
import os
dirname = os.path.dirname(__file__)
filename = os.path.join(dirname, "../bin/vl53l0x_python.so")
tof_lib = CDLL(filename)

I've never worked/used ctypes and I'm sure this is not the best solution but I cannot understand if I'm doing something wrong or if it is really a library issue.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions