python spidev module can't install on iMX8MM EVK target, Error : unable to execute 'aarch64-poky-linux-gcc': No such file or directory

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

python spidev module can't install on iMX8MM EVK target, Error : unable to execute 'aarch64-poky-linux-gcc': No such file or directory

2,741 Views
sreedhar_appala
Contributor IV

Hi,

 

I am working with iMX8MM EVK and Yocto distribution 4.19.35 version

 

Build Configuration:
BB_VERSION = "1.42.0"
BUILD_SYS = "x86_64-linux"
NATIVELSBSTRING = "ubuntu-16.04"
TARGET_SYS = "aarch64-poky-linux"
MACHINE = "imx8mmevk"
DISTRO = "fsl-imx-xwayland"
DISTRO_VERSION = "4.19-warrior"
TUNE_FEATURES = "aarch64"
TARGET_FPU = ""

I tried to install the spidev module by executing the following command, It throws the below error for 3.5 and 2.0 versions

root@imx8mmevk~#pip install spidev

Collecting spidev
Using cached https://files.pythonhosted.org/packages/62/56/de649e7d95f9fcfaf965a6eb937b4a46bc77ef21487c99cde1a7a0...
Installing collected packages: spidev
Running setup.py install for spidev: started
Running setup.py install for spidev: finished with status 'error'
Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-viptTX/spidev/setup.py';f=getattr(tokenize, 'open', open)
running install
running build
running build_ext
building 'spidev' extension
creating build
creating build/temp.linux-aarch64-2.7
aarch64-poky-linux-gcc -fno-strict-aliasing -O2 -pipe -g -feliminate-unused-debug-types -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c
unable to execute 'aarch64-poky-linux-gcc': No such file or directory
error: command 'aarch64-poky-linux-gcc' failed with exit status 1

----------------------------------------

Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-viptTX/spidev/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-OzSsDF/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-viptTX/spidev/

===========================================================================================

root@imx8mmevk~#pip install spidev==2.0

Collecting spidev==2.0
Using cached https://files.pythonhosted.org/packages/bf/59/ec1104f4b9d6b64873b8470121e89abf6a731ab9209151eb75e2ba...
Installing collected packages: spidev
Running setup.py install for spidev: started
Running setup.py install for spidev: finished with status 'error'
Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-tBBgAP/spidev/setup.py';f=getattr(tokenize, 'open', open)
running install
running build
running build_ext
building 'spidev' extension
creating build
creating build/temp.linux-aarch64-2.7
aarch64-poky-linux-gcc -fno-strict-aliasing -O2 -pipe -g -feliminate-unused-debug-types -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/src/linux/include -I/
unable to execute 'aarch64-poky-linux-gcc': No such file or directory
error: command 'aarch64-poky-linux-gcc' failed with exit status 1

----------------------------------------

Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-tBBgAP/spidev/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-29Bk1L/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-tBBgAP/spidev/

=====================================================================================

could you please help to resolve the issue.

Thank you,

Sreedhar

0 Kudos
Reply
6 Replies

2,700 Views
Zhiming_Liu
NXP TechSupport
NXP TechSupport

Hi  Sreedhar A,

aarch64-poky-linux-gcc is in your yocto project. You can move them to your board  and set them to your board's env.

Location: /tmp/sysroots-components/x86_64/gcc-cross-aarch64/usr/bin/aarch64-poky-linux/

Best Regards,

Zhiming

0 Kudos
Reply

2,700 Views
sreedhar_appala
Contributor IV

Hi Zhiming Liu,

Thank you for the quick response.

I could locate the aarch64-poky-linux-gcc" in Yocto Build Project.

"aarch64-poky-linux-gcc is in your yocto project. You can move them to your board  and set them to your board's env."

Could you please share the steps to set into the board environment.

My board environment details:

root@imx8mmevk:~# printenv
SSH_CONNECTION=::ffff:192.168.10.5 52319 ::ffff:192.168.10.5 22
TZ=UTC
EDITOR=vi
USER=root
PWD=/home/root
HOME=/home/root
SSH_CLIENT=::ffff:192.168.10.5 52319 22
SSH_TTY=/dev/pts/0
TERM=xterm
SHELL=/bin/sh
SHLVL=1
LOGNAME=root
XDG_RUNTIME_DIR=/run/user/0
PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin
PS1=\u@\h:\w\$
_=/bin/printenv
OLDPWD=/opt

Thank you,

Sreedhar

0 Kudos
Reply

2,700 Views
Zhiming_Liu
NXP TechSupport
NXP TechSupport

For example,you copy the aarch64-poky-linux/ to the board's /opt .Then vim the /etc/profile and add 'export PATH=$PATH:/opt/aarch64-poky-linux' to the last line.

Remember 'source /etc/profile'

0 Kudos
Reply

2,700 Views
sreedhar_appala
Contributor IV

Thank you Zhiming Liu

0 Kudos
Reply

2,671 Views
sreedhar_appala
Contributor IV

Hi Zhiming Liu,

Thank you for the support. today i tried installing spidev module using pip command.

I am getting the following error:

root@imx8mmevk:~# pip install spidev==2.0
Collecting spidev==2.0
Using cached https://files.pythonhosted.org/packages/bf/59/ec1104f4b9d6b64873b8470121e89abf6a731ab9209151eb75e2ba...
Installing collected packages: spidev
Running setup.py install for spidev ... error
Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-xmVwa3/spidev/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-olczUx/install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_ext
building 'spidev' extension
creating build
creating build/temp.linux-aarch64-2.7
aarch64-poky-linux-gcc -fno-strict-aliasing -O2 -pipe -g -feliminate-unused-debug-types -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/src/linux/include -I/usr/include/python2.7 -c spidev_module.c -o build/temp.linux-aarch64-2.7/spidev_module.o
unable to execute 'aarch64-poky-linux-gcc': Exec format error
error: command 'aarch64-poky-linux-gcc' failed with exit status 1

----------------------------------------
Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-xmVwa3/spidev/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-olczUx/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-xmVwa3/spidev/

 

Thank you, Sreedhar

0 Kudos
Reply

2,657 Views
Zhiming_Liu
NXP TechSupport
NXP TechSupport

Hi,

 

You can try to use the toolchains in python 2.7.

/tmp/work/aarch64-poky-linux/python/2.7.16-r0/recipe-sysroot-native/usr/bin/aarch64-poky-linux/

or

/tmp/work/aarch64-poky-linux/python/2.7.16-r0/recipe-sysroot-native/usr/libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/9.2.0/

 

0 Kudos
Reply