Menu

#156 Compilation/Syntax error on Windows 10 when installing via pip

Invalid
None
High
Defect
2018-06-02
2018-01-07
Z Feuerborn
No

Installing via pip, I get the following error on windows? pip is trying to install the latest 0.6.3 version. The command I am running to install it is:

PS C:> python.exe -m pip install RPi.GPIO

PS C:\> python.exe -m pip install RPi.GPIO
Collecting RPi.GPIO
  Using cached RPi.GPIO-0.6.3.tar.gz
Building wheels for collected packages: RPi.GPIO
  Running setup.py bdist_wheel for RPi.GPIO ... error
  Complete output from command C:\Python34\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\zac\\AppData\\Local\\Temp\\pip-build-qzcle8q2\\RPi.GPIO\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d C:\Users\zac\AppData\Local\Temp\tmp1qyg8_dwpip-wheel- --python-tag cp34:
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build\lib.win-amd64-3.4
  creating build\lib.win-amd64-3.4\RPi
  copying RPi\__init__.py -> build\lib.win-amd64-3.4\RPi
  creating build\lib.win-amd64-3.4\RPi\GPIO
  copying RPi\GPIO\__init__.py -> build\lib.win-amd64-3.4\RPi\GPIO
  running build_ext
  building 'RPi._GPIO' extension
  creating build\temp.win-amd64-3.4
  creating build\temp.win-amd64-3.4\Release
  creating build\temp.win-amd64-3.4\Release\source
  C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\Bin\x86_amd64\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -IC:\Python34\include -IC:\Python34\include /Tcsource/py_gpio.c /Fobuild\temp.win-amd64-3.4\Release\source/py_gpio.obj
  py_gpio.c
  source/py_gpio.c(87) : error C2143: syntax error : missing ';' before '{'
  source/py_gpio.c(115) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data
  source/py_gpio.c(119) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data
  source/py_gpio.c(200) : error C2143: syntax error : missing ';' before '{'
  source/py_gpio.c(227) : warning C4047: 'return' : 'PyObject *' differs in levels of indirection from 'int'
  source/py_gpio.c(289) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data
  source/py_gpio.c(291) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data
  source/py_gpio.c(345) : error C2373: 'output' : redefinition; different type modifiers
          c:\users\zac\appdata\local\temp\pip-build-qzcle8q2\rpi.gpio\source\constants.h(29) : see declaration of 'output'
  source/py_gpio.c(345) : error C2143: syntax error : missing ';' before '{'
  source/py_gpio.c(359) : warning C4047: 'return' : 'PyObject *' differs in levels of indirection from 'int'
  source/py_gpio.c(406) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data
  source/py_gpio.c(408) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data
  source/py_gpio.c(410) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data
  source/py_gpio.c(412) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data
  error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\Bin\\x86_amd64\\cl.exe' failed with exit status 2

  ----------------------------------------
  Failed building wheel for RPi.GPIO
  Running setup.py clean for RPi.GPIO
Failed to build RPi.GPIO
Installing collected packages: RPi.GPIO
  Running setup.py install for RPi.GPIO ... error
    Complete output from command C:\Python34\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\zac\\AppData\\Local\\Temp\\pip-build-qzcle8q2\\RPi.GPIO\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\zac\AppData\Local\Temp\pip-eeazcnxr-record\install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_py
    creating build
    creating build\lib.win-amd64-3.4
    creating build\lib.win-amd64-3.4\RPi
    copying RPi\__init__.py -> build\lib.win-amd64-3.4\RPi
    creating build\lib.win-amd64-3.4\RPi\GPIO
    copying RPi\GPIO\__init__.py -> build\lib.win-amd64-3.4\RPi\GPIO
    running build_ext
    building 'RPi._GPIO' extension
    creating build\temp.win-amd64-3.4
    creating build\temp.win-amd64-3.4\Release
    creating build\temp.win-amd64-3.4\Release\source
    C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\Bin\x86_amd64\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -IC:\Python34\include -IC:\Python34\include /Tcsource/py_gpio.c /Fobuild\temp.win-amd64-3.4\Release\source/py_gpio.obj
    py_gpio.c
    source/py_gpio.c(87) : error C2143: syntax error : missing ';' before '{'
    source/py_gpio.c(115) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data
    source/py_gpio.c(119) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data
    source/py_gpio.c(200) : error C2143: syntax error : missing ';' before '{'
    source/py_gpio.c(227) : warning C4047: 'return' : 'PyObject *' differs in levels of indirection from 'int'
    source/py_gpio.c(289) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data
    source/py_gpio.c(291) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data
    source/py_gpio.c(345) : error C2373: 'output' : redefinition; different type modifiers
            c:\users\zac\appdata\local\temp\pip-build-qzcle8q2\rpi.gpio\source\constants.h(29) : see declaration of 'output'
    source/py_gpio.c(345) : error C2143: syntax error : missing ';' before '{'
    source/py_gpio.c(359) : warning C4047: 'return' : 'PyObject *' differs in levels of indirection from 'int'
    source/py_gpio.c(406) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data
    source/py_gpio.c(408) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data
    source/py_gpio.c(410) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data
    source/py_gpio.c(412) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'int', possible loss of data
    error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\Bin\\x86_amd64\\cl.exe' failed with exit status 2

    ----------------------------------------
Command "C:\Python34\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\zac\\AppData\\Local\\Temp\\pip-build-qzcle8q2\\RPi.GPIO\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\zac\AppData\Local\Temp\pip-eeazcnxr-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\zac\AppData\Local\Temp\pip-build-qzcle8q2\RPi.GPIO\

Disclaimer, I am new to both Python and Pi development, so this might just be a PEBCAK.

My main goal is to just get the library installed for PyCharm to pick it up to autompletion, so I am under no illusions that I will get this to actually run under my normal dev box.

Discussion

  • Ben Croston

    Ben Croston - 2018-06-02

    RPi.GPIO is designed to run on a Raspberry Pi running Linux only.

     
  • Ben Croston

    Ben Croston - 2018-06-02
    • status: New --> Invalid
    • assigned_to: Ben Croston
     

Log in to post a comment.