Problems accessing MCP3008 via SPI - Invalid argument

Did you enable a Device Tree Overlay for SPI?

It looks like you’re using Blinka, both it and libgpiod need to be installed through apt, don’t install libgpiod through pip. You didn’t show your imports, so I don’t know what the module “pin” is from, I’d use board instead, and implicitly specify pin numbers rather than board.SCLK, etc. I also needed to use adafruit_extended_bus rather than busio to get i2c working, it would be a good idea to use this instead because it allows you to specify the device.