# Installing spidev

**URL:** https://dietpi.com/forum/t/installing-spidev/17779
**Category:** Troubleshooting
**Created:** [30 August 2023 02:46 UTC](https://dietpi.com/forum/t/installing-spidev/17779 "2023-08-30T02:46:47Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![DBorello](https://dietpi.com/forum/user_avatar/dietpi.com/dborello/32/4569_2.png) [@DBorello](https://dietpi.com/forum/u/DBorello)
#### Post date: [30 August 2023 02:46 UTC](https://dietpi.com/forum/t/installing-spidev/17779/1 "2023-08-30T02:46:47Z")

</div>

I am trying to install the python module spidev on a clean install. I have tried two ways:

```auto
root@PiGi:~# apt install python3-spidev
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 python3-spidev : Depends: python3 (< 3.10) but 3.11.2-1 is to be installed
E: Unable to correct problems, you have held broken packages.

```

```auto
root@PiGi:~# pip install spidev
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple/
Collecting spidev
  Downloading spidev-3.6.tar.gz (11 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Installing backend dependencies ... done
  Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: spidev
  Building wheel for spidev (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Building wheel for spidev (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [23 lines of output]
      /tmp/pip-build-env-9b8q41f0/overlay/local/lib/python3.11/dist-packages/setuptools/dist.py:744: SetuptoolsDeprecationWarning: Invalid dash-separated options
      !!

              ********************************************************************************
              Usage of dash-separated 'description-file' will not be supported in future
              versions. Please use the underscore name 'description_file' instead.

              By 2023-Sep-26, you need to update your project and remove deprecated calls
              or your builds will no longer be supported.

              See https://setuptools.pypa.io/en/latest/userguide/declarative_config.html for details.
              ********************************************************************************

      !!
        opt = self.warn_dash_deprecation(opt, section)
      running bdist_wheel
      running build
      running build_ext
      building 'spidev' extension
      creating build
      creating build/temp.linux-armv6l-cpython-311
      arm-linux-gnueabihf-gcc -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -I/usr/include/python3.11 -c spidev_module.c -o build/temp.linux-armv6l-cpython-311/spidev_module.o
      error: command 'arm-linux-gnueabihf-gcc' failed: No such file or directory
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for spidev

```

Any suggestions?

---

<div class="post-metadata">

### Author: ![Jappe](https://dietpi.com/forum/user_avatar/dietpi.com/jappe/32/1788_2.png) [@Jappe](https://dietpi.com/forum/u/Jappe)
#### Post date: [30 August 2023 06:42 UTC](https://dietpi.com/forum/t/installing-spidev/17779/2 "2023-08-30T06:42:52Z")

</div>

Can you please fill out the troubleshooting template?  
When Iook I [here](https://packages.debian.org/bookworm/python3-spidev) python3-spidev should need python3 (\< 3.12) and not \< 3.10.  
Did you tried `apt update` before installation?

---

<div class="post-metadata">

### Author: ![DBorello](https://dietpi.com/forum/user_avatar/dietpi.com/dborello/32/4569_2.png) [@DBorello](https://dietpi.com/forum/u/DBorello)
#### Post date: [30 August 2023 11:50 UTC](https://dietpi.com/forum/t/installing-spidev/17779/3 "2023-08-30T11:50:52Z")

</div>

I did run apt update first:

```auto
root@PiGi:~# apt update
Get:1 http://raspbian.raspberrypi.org/raspbian bookworm InRelease [15.0 kB]
Hit:2 https://archive.raspberrypi.org/debian bullseye InRelease
Fetched 15.0 kB in 3s (4,929 B/s)
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
All packages are up to date.
root@PiGi:~# apt install python3-spidev
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 python3-spidev : Depends: python3 (< 3.10) but 3.11.2-1 is to be installed
E: Unable to correct problems, you have held broken packages.

```

#### Required Information

- DietPi version | G\_DIETPI\_VERSION\_CORE=8  
G\_DIETPI\_VERSION\_SUB=21  
G\_DIETPI\_VERSION\_RC=1

- Distro version | bookworm 1

- Kernel version | Linux PiGi 6.1.21+ #1642 Mon Apr 3 17:19:14 BST 2023 armv6l GNU/Linux

- Architecture | armhf

- SBC model | RPi Zero W (armv6l)

---

<div class="post-metadata">

### Author: ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)
#### Post date: [30 August 2023 12:16 UTC](https://dietpi.com/forum/t/installing-spidev/17779/4 "2023-08-30T12:16:50Z")

</div>

ok I see. `python3-spidev` is pulled from `https://archive.raspberrypi.org/` Bullseye repository, while `python3` is pulled from `http://raspbian.raspberrypi.org/` Bookworm repository. This is causing a conflict between versions now. Unfortunately there is still no Bookworm repository available from `https://archive.raspberrypi.org/` 😮‍💨

The other method tried is the pyton pip install. There you are missing some compiler 😉

> [@DBorello](#):
>
> `error: command 'arm-linux-gnueabihf-gcc' failed: No such file or directory`

you could try following to install required files

```auto
apt install gcc-arm-linux-gnueabihf

```

---

<div class="post-metadata">

### Author: ![DBorello](https://dietpi.com/forum/user_avatar/dietpi.com/dborello/32/4569_2.png) [@DBorello](https://dietpi.com/forum/u/DBorello)
#### Post date: [30 August 2023 13:13 UTC](https://dietpi.com/forum/t/installing-spidev/17779/5 "2023-08-30T13:13:13Z")

</div>

Perfect, thanks!
