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 wheel metadata ... done Building wheels for collected packages: spidev Building wheel for spidev (PEP 517) ... error ERROR: Command errored out with exit status 1: command: 'C:\Users\Y\AppData\Local\Programs\Python\Python311-32\python.exe' 'C:\Users\Y\AppData\Local\Programs\Python\Python311-32\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py' build_wheel 'C:\Users\Y\AppData\Local\Temp\tmp_nif02uj' cwd: C:\Users\Y\AppData\Local\Temp\pip-install-1l6gbx2c\spidev_66aac4f6de92406b812e0ab010d35e91 Complete output (26 lines): C:\Users\Y\AppData\Local\Temp\pip-build-env-ehvsnss7\overlay\Lib\site-packages\setuptools\dist.py:745: 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.win32-cpython-311 creating build\temp.win32-cpython-311\Release "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\HostX86\x86\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -IC:\Users\Y\AppData\Local\Programs\Python\Python311-32\include -IC:\Users\Y\AppData\Local\Programs\Python\Python311-32\Include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\ATLMFC\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\cppwinrt" /Tcspidev_module.c /Fobuild\temp.win32-cpython-311\Release\spidev_module.obj spidev_module.c spidev_module.c(33): fatal error C1083: 无法打开包括文件: “linux/spi/spidev.h”: No such file or directory error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.29.30133\\bin\\HostX86\\x86\\cl.exe' failed with exit code 2 ---------------------------------------- ERROR: Failed building wheel for spidev Failed to build spidev ERROR: Could not build wheels for spidev which use PEP 517 and cannot be installed directly WARNING: You are using pip version 21.2.4; however, version 23.2 is available. You should consider upgrading via the 'C:\Users\Y\AppData\Local\Programs\Python\Python311-32\python.exe -m pip install --upgrade pip' command.
时间: 2023-08-14 18:05:53 浏览: 415
opencv-python-4.10.0.84.tar.gz
5星 · 资源好评率100%
根据你提供的安装日志,看起来在构建Spidev库的过程中出现了一些问题。具体来说,错误提示显示无法找到 "linux/spi/spidev.h" 文件,这可能是由于你的系统不是基于Linux平台而引起的。
Spidev库通常是用于在Linux系统上与SPI设备进行通信的。如果你正在使用的是Windows系统,那么Spidev库可能无法直接在该系统上构建和安装。
在Windows系统上与SPI设备进行通信,你可以考虑使用其他适用于Windows的SPI库,例如`py-spidev`或`Adafruit_GPIO`等。这些库提供了类似Spidev库的功能,并且适用于Windows平台。
请注意,我无法提供关于特定库的详细安装说明,因为具体步骤可能因库的版本、硬件平台和操作系统而有所不同。建议你参考所选库的官方文档或相关资源,以获取适用于Windows系统的安装和使用指南。
此外,你还注意到提示了pip版本的升级问题。你可以按照提示使用以下命令来升级pip:
```
C:\Users\Y\AppData\Local\Programs\Python\Python311-32\python.exe -m pip install --upgrade pip
```
希望这些信息对你有所帮助。如果你有任何其他问题,请随时提问。
阅读全文