0

I've tried pip and easy_install with a couple different packages (RPi.GPIO, GPIO) and each one returns the same error when it runs:

C:\Python37\Scripts>easy_install RPIO
Searching for RPIO
Reading https://pypi.org/simple/RPIO/
Downloading https://files.pythonhosted.org/packages/29/05/6884572923c57ff488fdf5c4ab887deb9edb2515afbcb49be087c95ac698/RPIO-0.10.0.tar.gz#sha256=b89f75dec9de354681209ebfaedfe22b7c178aacd91a604a7bd6d92024e4cf7e
Best match: RPIO 0.10.0
Processing RPIO-0.10.0.tar.gz
Writing C:\Users\arnjm\AppData\Local\Temp\easy_install-ytbbi35y\RPIO-0.10.0\setup.cfg
Running RPIO-0.10.0\setup.py -q bdist_egg --dist-dir C:\Users\arnjm\AppData\Local\Temp\easy_install-ytbbi35y\RPIO-0.10.0\egg-dist-tmp-fbmuup99
py_gpio.c
source/c_gpio/py_gpio.c(362): error C2040: 'setmode': 'PyObject *(PyObject *,PyObject *)' differs in levels of indirection from 'int (int,int)'
source/c_gpio/py_gpio.c(431): warning C4028: formal parameter 1 different from declaration
source/c_gpio/py_gpio.c(431): warning C4028: formal parameter 2 different from declaration
source/c_gpio/py_gpio.c(431): warning C4047: 'initializing': 'PyCFunction' differs in levels of indirection from 'int (__cdecl *)(int,int)'
error: Setup script exited with error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC\\Tools\\MSVC\\14.15.26726\\bin\\HostX86\\x64\\cl.exe' failed with exit status 2

Hopefully someone has solved this already.

hoefling
  • 59,418
  • 12
  • 147
  • 194
arnjmllr
  • 93
  • 4
  • https://stackoverflow.com/questions/39771592/visual-c-for-python-failed-with-exit-status-2-when-installing-divisi2 – xrisk Oct 20 '18 at 20:58
  • Two issues: 1. You are using windows, but both RPIO and RPi.GPIO are implemented for Linux only and 2. you are not running a raspberry pi. Even if you switch to Linux e.g. inside a docker container, you will be able to compile RPIO, but you will be missing the actual pins, so the libs will be useless. – hoefling Oct 20 '18 at 21:29
  • Thanks for the reply. I am able to install and use on the raspberry pi, but was thinking for development it was also possible to load packages and have intellisense. I had read and installed (C++ build tools mentioned by Rishav above before with no luck) so it seems like this should be possible. I was able to to this with the gpio package. i develop in vs code on windows and then copy files over to run on raspberry pi. – arnjmllr Oct 20 '18 at 22:06
  • 1
    Thing is, you won't be able to develop on windows even if you manage to compile RPIO; you'll get various errors once the lib tries to query `/dev/mem` or `/proc/cpuinfo` etc. Instead, check whether VS has an option of remote debugging/remote interpreter configuration/etc (I don't use VS, but pretty sure it has that, or some plugin for that exists), make sure your raspberry pi is accessible via network and configure your IDE to use raspi's interpreter remotely. – hoefling Oct 20 '18 at 23:44

0 Answers0