pimoroni / inky

Combined library for V2/V3 Inky pHAT and Inky wHAT.
https://shop.pimoroni.com/?q=inky
MIT License
578 stars 121 forks source link

'pip3 install inky' fails to install 'spidev' dependency #147

Closed JRiggles closed 1 year ago

JRiggles commented 2 years ago

Running the command pip3 install inky fails with the following output:

 ~/.p/v/3/lib ❯ pip3 install inky                                                                                            21:25:51
Collecting inky
  Using cached inky-1.3.2.tar.gz (21 kB)
  Preparing metadata (setup.py) ... done
Collecting numpy
  Using cached numpy-1.23.0-cp310-cp310-macosx_11_0_arm64.whl (13.3 MB)
Collecting smbus2
  Using cached smbus2-0.4.2-py2.py3-none-any.whl (11 kB)
Collecting spidev
  Using cached spidev-3.5.tar.gz (10 kB)
  Preparing metadata (setup.py) ... done
Using legacy 'setup.py install' for inky, since package 'wheel' is not installed.
Using legacy 'setup.py install' for spidev, since package 'wheel' is not installed.
Installing collected packages: spidev, smbus2, numpy, inky
  Running setup.py install for spidev ... error
  error: subprocess-exited-with-error

  × Running setup.py install for spidev did not run successfully.
  │ exit code: 1
  ╰─> [14 lines of output]
      /Users/jriggles/.pyenv/versions/3.10.4/lib/python3.10/site-packages/setuptools/dist.py:717: UserWarning: Usage of dash-separated 'description-file' will not be supported in future versions. Please use the underscore name 'description_file' instead
        warnings.warn(
      running install
      running build
      running build_ext
      building 'spidev' extension
      creating build
      creating build/temp.macosx-12.4-arm64-3.10
      clang -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include -I/Users/jriggles/.pyenv/versions/3.10.4/include/python3.10 -c spidev_module.c -o build/temp.macosx-12.4-arm64-3.10/spidev_module.o
      spidev_module.c:33:10: fatal error: 'linux/spi/spidev.h' file not found
      #include <linux/spi/spidev.h>
               ^~~~~~~~~~~~~~~~~~~~
      1 error generated.
      error: command '/usr/bin/clang' failed with exit code 1
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> spidev

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.

The issue appears to be related to the 'spidev' package, because running pip3 install spidev returns a similar error

Environment Info: macOS 12.4 arm64 Python 3.10.4

Gadgetoid commented 1 year ago

macOS !?!?

I guess if you want to use the simulator or have the code locally for intellisense and such you can grab the source, delete this dependency and install it from the local files.

I don't think we can conditionally include a dependency in a way that doesn't make it overcomplicated for Pi/Linux users so this probably wont be fixed.