Jump to content

RPi.GPIO python module refuses to install in Visual Studio Code

AndreiArgeanu

I'm trying to install the raspberry pi GPIO module in Visual Studio Code but it just refuses to do so, originally it needed visual c++ which I got from microsoft's website and I don't really have any idea as to why it doesn't want to install. I tried launching Visual Studio Code with administrator privileges as well and still nothing. Also I have all these versions of Visual C++, most of them I don't think I installed myself anyway.

image.png.e7d85fd7a30b232f955caafae0d26184.png

Spoiler



Collecting RPi.GPIO
  Using cached RPi.GPIO-0.7.0.tar.gz (30 kB)
Building wheels for collected packages: RPi.GPIO
  Building wheel for RPi.GPIO (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: 'c:\users\andrei\appdata\local\programs\python\python38-32\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Andrei\\AppData\\Local\\Temp\\pip-install-tkjr4jwu\\rpi-gpio_fc34c505547743b394f7e79bee903ae4\\setup.py'"'"'; __file__='"'"'C:\\Users\\Andrei\\AppData\\Local\\Temp\\pip-install-tkjr4jwu\\rpi-gpio_fc34c505547743b394f7e79bee903ae4\\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\Andrei\AppData\Local\Temp\pip-wheel-7tggycbf'
       cwd: C:\Users\Andrei\AppData\Local\Temp\pip-install-tkjr4jwu\rpi-gpio_fc34c505547743b394f7e79bee903ae4\
  Complete output (18 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build\lib.win32-3.8
  creating build\lib.win32-3.8\RPi
  copying RPi\__init__.py -> build\lib.win32-3.8\RPi
  creating build\lib.win32-3.8\RPi\GPIO
  copying RPi\GPIO\__init__.py -> build\lib.win32-3.8\RPi\GPIO
  running build_ext
  building 'RPi._GPIO' extension
  creating build\temp.win32-3.8
  creating build\temp.win32-3.8\Release
  creating build\temp.win32-3.8\Release\source
  C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.28.29333\bin\HostX86\x86\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Ic:\users\andrei\appdata\local\programs\python\python38-32\include -Ic:\users\andrei\appdata\local\programs\python\python38-32\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.28.29333\include" /Tcsource/py_gpio.c /Fobuild\temp.win32-3.8\Release\source/py_gpio.obj
  py_gpio.c
  c:\users\andrei\appdata\local\programs\python\python38-32\include\pyconfig.h(59): fatal error C1083: Cannot open include file: 'io.h': No such file or directory
  error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.28.29333\\bin\\HostX86\\x86\\cl.exe' failed with exit status 2
  ----------------------------------------
  ERROR: 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
    ERROR: Command errored out with exit status 1:
     command: 'c:\users\andrei\appdata\local\programs\python\python38-32\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Andrei\\AppData\\Local\\Temp\\pip-install-tkjr4jwu\\rpi-gpio_fc34c505547743b394f7e79bee903ae4\\setup.py'"'"'; __file__='"'"'C:\\Users\\Andrei\\AppData\\Local\\Temp\\pip-install-tkjr4jwu\\rpi-gpio_fc34c505547743b394f7e79bee903ae4\\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\Andrei\AppData\Local\Temp\pip-record-7zhmg0u0\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\andrei\appdata\local\programs\python\python38-32\Include\RPi.GPIO'
         cwd: C:\Users\Andrei\AppData\Local\Temp\pip-install-tkjr4jwu\rpi-gpio_fc34c505547743b394f7e79bee903ae4\
    Complete output (18 lines):
    running install
    running build
    running build_py
    creating build
    creating build\lib.win32-3.8
    creating build\lib.win32-3.8\RPi
    copying RPi\__init__.py -> build\lib.win32-3.8\RPi
    creating build\lib.win32-3.8\RPi\GPIO
    copying RPi\GPIO\__init__.py -> build\lib.win32-3.8\RPi\GPIO
    running build_ext
    building 'RPi._GPIO' extension
    creating build\temp.win32-3.8
    creating build\temp.win32-3.8\Release
    creating build\temp.win32-3.8\Release\source
    C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.28.29333\bin\HostX86\x86\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Ic:\users\andrei\appdata\local\programs\python\python38-32\include -Ic:\users\andrei\appdata\local\programs\python\python38-32\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.28.29333\include" /Tcsource/py_gpio.c /Fobuild\temp.win32-3.8\Release\source/py_gpio.obj
    py_gpio.c
    c:\users\andrei\appdata\local\programs\python\python38-32\include\pyconfig.h(59): fatal error C1083: Cannot open include file: 'io.h': No such file or directory
    error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.28.29333\\bin\\HostX86\\x86\\cl.exe' failed with exit status 2
    ----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\users\andrei\appdata\local\programs\python\python38-32\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Andrei\\AppData\\Local\\Temp\\pip-install-tkjr4jwu\\rpi-gpio_fc34c505547743b394f7e79bee903ae4\\setup.py'"'"'; __file__='"'"'C:\\Users\\Andrei\\AppData\\Local\\Temp\\pip-install-tkjr4jwu\\rpi-gpio_fc34c505547743b394f7e79bee903ae4\\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\Andrei\AppData\Local\Temp\pip-record-7zhmg0u0\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\andrei\appdata\local\programs\python\python38-32\Include\RPi.GPIO' Check the logs for full command output.

 

 

Link to comment
Share on other sites

Link to post
Share on other sites

14 minutes ago, Sauron said:

Still doesn't work for some reason. kind of already installed that but didn't have the W10 SDK, also the new installer doesn't have any 2017 stuff. Not sure if there's anything I missed. Also now it looks like trying to install the module it just spits out a bunch of syntax errors for some reason

Spoiler


Collecting RPi.GPIO
  Using cached RPi.GPIO-0.7.0.tar.gz (30 kB)
Building wheels for collected packages: RPi.GPIO
  Building wheel for RPi.GPIO (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: 'c:\users\andrei\appdata\local\programs\python\python38-32\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Andrei\\AppData\\Local\\Temp\\pip-install-goxasihn\\rpi-gpio_cc917e7721f74632b535128a0a9be8f6\\setup.py'"'"'; __file__='"'"'C:\\Users\\Andrei\\AppData\\Local\\Temp\\pip-install-goxasihn\\rpi-gpio_cc917e7721f74632b535128a0a9be8f6\\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\Andrei\AppData\Local\Temp\pip-wheel-s26uyn_j' 
       cwd: C:\Users\Andrei\AppData\Local\Temp\pip-install-goxasihn\rpi-gpio_cc917e7721f74632b535128a0a9be8f6\
  Complete output (24 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build\lib.win32-3.8
  creating build\lib.win32-3.8\RPi
  copying RPi\__init__.py -> build\lib.win32-3.8\RPi
  creating build\lib.win32-3.8\RPi\GPIO
  copying RPi\GPIO\__init__.py -> build\lib.win32-3.8\RPi\GPIO
  running build_ext
  building 'RPi._GPIO' extension
  creating build\temp.win32-3.8
  creating build\temp.win32-3.8\Release
  creating build\temp.win32-3.8\Release\source
  C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.28.29333\bin\HostX86\x86\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Ic:\users\andrei\appdata\local\programs\python\python38-32\include -Ic:\users\andrei\appdata\local\programs\python\python38-32\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.28.29333\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\cppwinrt" /Tcsource/py_gpio.c /Fobuild\temp.win32-3.8\Release\source/py_gpio.obj
  py_gpio.c
  source/py_gpio.c(87): error C2143: syntax error: missing ';' before '{'
  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(345): error C2373: 'output': redefinition; different type modifiers
  C:\Users\Andrei\AppData\Local\Temp\pip-install-goxasihn\rpi-gpio_cc917e7721f74632b535128a0a9be8f6\source\constants.h(29): note: 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'
  error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.28.29333\\bin\\HostX86\\x86\\cl.exe' failed with exit status 2
  ----------------------------------------
  ERROR: 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
    ERROR: Command errored out with exit status 1:
     command: 'c:\users\andrei\appdata\local\programs\python\python38-32\python.exe' -u -c 'import sys, setuptools, tokenize; 
sys.argv[0] = '"'"'C:\\Users\\Andrei\\AppData\\Local\\Temp\\pip-install-goxasihn\\rpi-gpio_cc917e7721f74632b535128a0a9be8f6\\setup.py'"'"'; __file__='"'"'C:\\Users\\Andrei\\AppData\\Local\\Temp\\pip-install-goxasihn\\rpi-gpio_cc917e7721f74632b535128a0a9be8f6\\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\Andrei\AppData\Local\Temp\pip-record-3mgv8gyr\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\andrei\appdata\local\programs\python\python38-32\Include\RPi.GPIO'
         cwd: C:\Users\Andrei\AppData\Local\Temp\pip-install-goxasihn\rpi-gpio_cc917e7721f74632b535128a0a9be8f6\
    Complete output (24 lines):
    running install
    running build
    running build_py
    creating build
    creating build\lib.win32-3.8
    creating build\lib.win32-3.8\RPi
    copying RPi\__init__.py -> build\lib.win32-3.8\RPi
    creating build\lib.win32-3.8\RPi\GPIO
    copying RPi\GPIO\__init__.py -> build\lib.win32-3.8\RPi\GPIO
    running build_ext
    building 'RPi._GPIO' extension
    creating build\temp.win32-3.8
    creating build\temp.win32-3.8\Release
    creating build\temp.win32-3.8\Release\source
    C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.28.29333\bin\HostX86\x86\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Ic:\users\andrei\appdata\local\programs\python\python38-32\include -Ic:\users\andrei\appdata\local\programs\python\python38-32\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.28.29333\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\um" "-IC:\Program Files (x86)\Windows 
Kits\10\include\10.0.16299.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\cppwinrt" /Tcsource/py_gpio.c /Fobuild\temp.win32-3.8\Release\source/py_gpio.obj
    py_gpio.c
    source/py_gpio.c(87): error C2143: syntax error: missing ';' before '{'
    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(345): error C2373: 'output': redefinition; different type modifiers
    C:\Users\Andrei\AppData\Local\Temp\pip-install-goxasihn\rpi-gpio_cc917e7721f74632b535128a0a9be8f6\source\constants.h(29): 
note: 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'
    error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.28.29333\\bin\\HostX86\\x86\\cl.exe' failed with exit status 2
    ----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\users\andrei\appdata\local\programs\python\python38-32\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Andrei\\AppData\\Local\\Temp\\pip-install-goxasihn\\rpi-gpio_cc917e7721f74632b535128a0a9be8f6\\setup.py'"'"'; __file__='"'"'C:\\Users\\Andrei\\AppData\\Local\\Temp\\pip-install-goxasihn\\rpi-gpio_cc917e7721f74632b535128a0a9be8f6\\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\Andrei\AppData\Local\Temp\pip-record-3mgv8gyr\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\andrei\appdata\local\programs\python\python38-32\Include\RPi.GPIO' Check the logs for full command output.

 

image.thumb.png.c817f08441eeb32f4d70592490c3fe29.png

Link to comment
Share on other sites

Link to post
Share on other sites

33 minutes ago, AndreiArgeanu said:

Still doesn't work for some reason. kind of already installed that but didn't have the W10 SDK, also the new installer doesn't have any 2017 stuff. Not sure if there's anything I missed. Also now it looks like trying to install the module it just spits out a bunch of syntax errors for some reason

Why are you installing Visual Studio, Windows SDK and C++ - development tools, when you're trying to use a Python - module in Visual Studio Code? Visual Studio and Visual Studio Code are two different things and Windows SDK or any of the C++ - tools aren't needed for VSCode.

Hand, n. A singular instrument worn at the end of the human arm and commonly thrust into somebody’s pocket.

Link to comment
Share on other sites

Link to post
Share on other sites

12 minutes ago, WereCatf said:

Why are you installing Visual Studio, Windows SDK and C++ - development tools, when you're trying to use a Python - module in Visual Studio Code? Visual Studio and Visual Studio Code are two different things and Windows SDK or any of the C++ - tools aren't needed for VSCode.

The module needs it for some reason. I uninstalled it, and now I'm back at square 1.

image.png.1135c4e8834f0dd56b1e1012299511fd.png

With Visual Studio whatevers installed I get syntax errors and other stuff, regardless of whether I use pip install RPi.GPIO or whether I download the setup and run it as setup.py install

Spoiler

Collecting RPi.GPIO
  Using cached RPi.GPIO-0.7.0.tar.gz (30 kB)
Building wheels for collected packages: RPi.GPIO
  Building wheel for RPi.GPIO (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: 'c:\users\andrei\appdata\local\programs\python\python38-32\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Andrei\\AppData\\Local\\Temp\\pip-install-goxasihn\\rpi-gpio_cc917e7721f74632b535128a0a9be8f6\\setup.py'"'"'; __file__='"'"'C:\\Users\\Andrei\\AppData\\Local\\Temp\\pip-install-goxasihn\\rpi-gpio_cc917e7721f74632b535128a0a9be8f6\\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\Andrei\AppData\Local\Temp\pip-wheel-s26uyn_j' 
       cwd: C:\Users\Andrei\AppData\Local\Temp\pip-install-goxasihn\rpi-gpio_cc917e7721f74632b535128a0a9be8f6\
  Complete output (24 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build\lib.win32-3.8
  creating build\lib.win32-3.8\RPi
  copying RPi\__init__.py -> build\lib.win32-3.8\RPi
  creating build\lib.win32-3.8\RPi\GPIO
  copying RPi\GPIO\__init__.py -> build\lib.win32-3.8\RPi\GPIO
  running build_ext
  building 'RPi._GPIO' extension
  creating build\temp.win32-3.8
  creating build\temp.win32-3.8\Release
  creating build\temp.win32-3.8\Release\source
  C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.28.29333\bin\HostX86\x86\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Ic:\users\andrei\appdata\local\programs\python\python38-32\include -Ic:\users\andrei\appdata\local\programs\python\python38-32\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.28.29333\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\cppwinrt" /Tcsource/py_gpio.c /Fobuild\temp.win32-3.8\Release\source/py_gpio.obj
  py_gpio.c
  source/py_gpio.c(87): error C2143: syntax error: missing ';' before '{'
  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(345): error C2373: 'output': redefinition; different type modifiers
  C:\Users\Andrei\AppData\Local\Temp\pip-install-goxasihn\rpi-gpio_cc917e7721f74632b535128a0a9be8f6\source\constants.h(29): note: 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'
  error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.28.29333\\bin\\HostX86\\x86\\cl.exe' failed with exit status 2
  ----------------------------------------
  ERROR: 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
    ERROR: Command errored out with exit status 1:
     command: 'c:\users\andrei\appdata\local\programs\python\python38-32\python.exe' -u -c 'import sys, setuptools, tokenize; 
sys.argv[0] = '"'"'C:\\Users\\Andrei\\AppData\\Local\\Temp\\pip-install-goxasihn\\rpi-gpio_cc917e7721f74632b535128a0a9be8f6\\setup.py'"'"'; __file__='"'"'C:\\Users\\Andrei\\AppData\\Local\\Temp\\pip-install-goxasihn\\rpi-gpio_cc917e7721f74632b535128a0a9be8f6\\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\Andrei\AppData\Local\Temp\pip-record-3mgv8gyr\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\andrei\appdata\local\programs\python\python38-32\Include\RPi.GPIO'
         cwd: C:\Users\Andrei\AppData\Local\Temp\pip-install-goxasihn\rpi-gpio_cc917e7721f74632b535128a0a9be8f6\
    Complete output (24 lines):
    running install
    running build
    running build_py
    creating build
    creating build\lib.win32-3.8
    creating build\lib.win32-3.8\RPi
    copying RPi\__init__.py -> build\lib.win32-3.8\RPi
    creating build\lib.win32-3.8\RPi\GPIO
    copying RPi\GPIO\__init__.py -> build\lib.win32-3.8\RPi\GPIO
    running build_ext
    building 'RPi._GPIO' extension
    creating build\temp.win32-3.8
    creating build\temp.win32-3.8\Release
    creating build\temp.win32-3.8\Release\source
    C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.28.29333\bin\HostX86\x86\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Ic:\users\andrei\appdata\local\programs\python\python38-32\include -Ic:\users\andrei\appdata\local\programs\python\python38-32\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.28.29333\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\um" "-IC:\Program Files (x86)\Windows 
Kits\10\include\10.0.16299.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\cppwinrt" /Tcsource/py_gpio    py_gpio.c
    source/py_gpio.c(87): error C2143: syntax error: missing ';' before '{'
    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(345): error C2373: 'output': redefinition; different type modifiers
    C:\Users\Andrei\AppData\Local\Temp\pip-install-goxasihn\rpi-gpio_cc917e7721f74632b535128a0a9be8f6\source\constants.h(29): 
note: 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'
    error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.28.29333\\bin\\HostX86\\x86\\cl.exe' failed with exit status 2
    ----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\users\andrei\appdata\local\programs\python\python38-32\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Andrei\\AppData\\Local\\Temp\\pip-install-goxasihn\\rpi-gpio_cc917e7721f74632b535128a0a9be8f6\\setup.py'"'"'; __file__='"'"'C:\\Users\\Andrei\\AppData\\Local\\Temp\\pip-install-goxasihn\\rpi-gpio_cc917e7721f74632b535128a0a9be8f6\\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\Andrei\AppData\Local\Temp\pip-record-3mgv8gyr\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\andrei\appdata\local\programs\python\python38-32\Include\RPi.GPIO' Check the logs for full command output.

 

 

Link to comment
Share on other sites

Link to post
Share on other sites

12 minutes ago, AndreiArgeanu said:

The module needs it for some reason. I uninstalled it, and now I'm back at square 1.

image.png.1135c4e8834f0dd56b1e1012299511fd.png

With Visual Studio whatevers installed I get syntax errors and other stuff, regardless of whether I use pip install RPi.GPIO or whether I download the setup and run it as setup.py install

I took a look and I see why it wants those: it's trying to compile the GPIO-interfacing stuff from C-code. Alas, it's all Linux-specific.

Hand, n. A singular instrument worn at the end of the human arm and commonly thrust into somebody’s pocket.

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×