Unable to install python module "pip install VL53L1X"

Hello,

We are trying to install the laser sensor package using below command:
“pip install VL53L1X”

And encountering error, is listed below.

##########################################################
Installing collected packages: VL53L1X
Running setup.py install for VL53L1X … error
ERROR: Command errored out with exit status 1:
command: /usr/bin/python -u -c ‘import sys, setuptools, tokenize;
sys.argv[
0] =
‘"’"’/tmp/pip-install-TCwvOX/vl53l1x/setup.py’“'”‘;
file=’“'”'/tmp/pip-

install-TCwvOX/vl53l1x/setup.py’“'”‘;f=getattr(tokenize, ‘"’“‘open’”’"',
open)(_

file_);code=f.read().replace(‘"’“‘\r\n’”‘"’,
‘"’“‘\n’”‘"’);f.close();exec(comp

ile(code, file, ‘"’“‘exec’”‘"’))’ install --record
/tmp/pip-record-dpc483/in

stall-record.txt --single-version-externally-managed --compile
–install-headers

/usr/include/python2.7/VL53L1X
cwd: /tmp/pip-install-TCwvOX/vl53l1x/
Complete output (22 lines):
/usr/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown
distribution
option:
‘long_description_content_type’
warnings.warn(msg)
running install
running build
running build_py
creating build
creating build/lib.linux-armv7l-2.7
copying python/VL53L1X.py → build/lib.linux-armv7l-2.7
running build_ext
building ‘vl53l1x_python’ extension
creating build/temp.linux-armv7l-2.7
creating build/temp.linux-armv7l-2.7/api
creating build/temp.linux-armv7l-2.7/api/core
creating build/temp.linux-armv7l-2.7/api/platform
creating build/temp.linux-armv7l-2.7/python_lib
arm-angstrom-linux-gnueabi-gcc -march=armv7-a -mthumb -mfpu=neon
-mfloat-abi
=hard
-fno-strict-aliasing -O2 -pipe -g -feliminate-unused-debug-types
-fdebug-p

refix-map=/build/jenkins/v2017.12/compile/machine/colibri-vf/build/tmp-angstrom-

glibc/work/armv7at2hf-neon-angstrom-linux-gnueabi/python/2.7.13-r1=/usr/src/debu

                                g/python/2.7.13-r1

-fdebug-prefix-map=/build/jenkins/v2017.12/compile/machine/co

libri-vf/build/tmp-angstrom-glibc/work/armv7at2hf-neon-angstrom-linux-gnueabi/py

                                thon/2.7.13-r1/recipe-sysroot-native=

-fdebug-prefix-map=/build/jenkins/v2017.12

/compile/machine/colibri-vf/build/tmp-angstrom-glibc/work/armv7at2hf-neon-angstr

om-linux-gnueabi/python/2.7.13-r1/recipe-sysroot= -DNDEBUG -g -O3 -Wall
-Wstrict
-prototypes -fPIC -I.
-Iapi/core -Iapi/platform -I/usr/include/python2.7 -c api/

                  core/vl53l1_api_calibration.c -o

build/temp.linux-armv7l-2.7/api/core/vl53l1_api

       _calibration.o -std=c99

/usr/lib/gcc/arm-angstrom-linux-gnueabi/7.2.0/…/…/…/…/arm-angstrom-linux

                                -gnueabi/bin/as: error while loading

shared libraries: libbfd-2.29.0.20170912.so

   : cannot open shared object file: No such file or directory
 api/core/vl53l1_api_calibration.c:875:1: fatal error: error writing

to -: Br
oken pipe
}
^
compilation terminated.
error: command ‘arm-angstrom-linux-gnueabi-gcc’ failed with exit
status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python -u -c
‘import sys
, setuptools, tokenize;
sys.argv[0] = ‘"’"’/tmp/pip-install-TCwvOX/vl53l1x/setup

                .py'"'"';

file=‘"’“‘/tmp/pip-install-TCwvOX/vl53l1x/setup.py’”‘"’;f=getattr(

                              tokenize, '"'"'open'"'"',

open)(file);code=f.read().replace(‘"’“‘\r\n’”‘"’,

              '"'"'\n'"'"');f.close();exec(compile(code, __file__,

‘"’“‘exec’”‘"’))’ install -
-record
/tmp/pip-record-dpc483/install-record.txt --single-version-externally-ma

                                naged --compile --install-headers

/usr/include/python2.7/VL53L1X Check the logs

      for full command output.

#####################################################

Following are the software specification:

  1. linux version

Linux colibri-imx7-emmc 4.9.220-2.8.7+g57229263ff65 #1 SMP Wed Jun 10
17:21:48 UTC 2020 armv7l GNU/Linux

  1. We have installed “Toradex Embedded Linux Demo with LXDE” image

  2. GCC version -
    gcc - 7.2.0-r0.0 - GNU cc and gcc C compilers GNU cc and gcc C compilers.

Thanks

Hi,

It looks like python package you are installing need native compilation. You need to install proper toolchain, preferably build toolchain with Linux image using our reference BSP.

Additionally please check below post for more details on same. Issue seems to be of the compiler which is installed from feeds does not work.

Best Regards

Ritesh Kumar

Hi,
Thanks for your assistance. I’m able to install the python module

Best Regards,
Vrinda Nair

Perfect. Thanks for your feedback.