3
votes

I am working on a project that involves programming the raspberry pi windows 10 IoT core. I'm programming it in python, however I need to install the python module SpiDev. I have tried various ways all that return the same error as shown below. I have installed Visual C++ 2010 (Correct version for Python 3.4) as the compiler and I work in Visual Studio Enterprise 2015. From a command prompt I have tried installing with the following:

C:\Python34\python.exe -c "import setuptools, tokenize;__file__='C:\\Users\\jedho\\Downloads\\py-spidev-master\\py-spidev-master\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record C:\Users\jedho\install-record.txt --single-version-externally-managed --compile

with

C:\Python34\python.exe C:\Users\jedho\Downloads\py-spidev-master\py-spidev-master\setup.py install

Which contains the directory I downloaded SpiDev from

and via PIP with

C:\Python34\Scripts\pip3.exe install spidev

But all return the same error

C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -I/usr/src/linux/include -IC:\Python34\include -IC:\Python34\include /Tcinstall_spidev_module_EDIT.c /Fobuild\temp.win32-3.4\Release\install_spidev_module_EDIT.obj install_spidev_module_EDIT.c c1 : fatal error C1083: Cannot open source file: 'install_spidev_module_EDIT.c': No such file or directory error: command 'C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\cl.exe' failed with exit status 2

Please Help.

Thanks in advanced,

Jed Hodson

1
Same problem happening in Python 2.7 for Windows - Mark Lapasa

1 Answers

0
votes

The error happens since some software is platform-oriented. It seems like Windows does not support native RaspberryPI SpiDev.

How to emulate/mock functionality on different platform. Good explanation with wrapping example.

SpiDev which not likely work with Windows.

As temporary solution, the code can be written as small chunks in iPython on dedicated device and transferred to your Windows-based IDE.