I am working on rasberry3 pi b+ model for my project and I did installed NOOBS zip file and stored in Micro SD card and put in SD slot on Rasberry Pi b+.

When i'm compiling my python code for my project it shows error as "Module not found " in line "import RPi.GPIO as GPIO",when i was tried to install RPi package it shows version not compatable ' can you pls tell me what to do to get RPi package or what version shall i install.[ I am using windows 10 and python 3.5.3 version]

  • 1
    If I understand you correctly, you tried to run a python script (that's intended to run on a raspi) on you windows PC. That is not possible because your PC has no GPIO to work with. You do not need to compile the python on the windows computer before running it on the raspi. Just copy the text script files to the raspi and run it there. python myprog.py – Peter Paul Kiefer Oct 22 '19 at 16:28
  • 1
    Python has two versions. It is also very much case sensitive. import RPi.GPIO should work with python. Forget python (aka python2) ever existed. That package is already installed and ONLY works on a Raspberry. – Dougie Oct 22 '19 at 16:36
  • 1
    You are working on rasberry3 pi b+ for your project but you are using windows 10. What does this mean? What do you use, Raspberry Pi or MS Windows 10? If you use the latter then this is not the right place to ask. – Ingo Oct 22 '19 at 17:06
  • My project is an 'IOT" based project.I am using windows 10 just to compile my code. – Md Mastan Oct 23 '19 at 13:23
  • @MdMastan As others have already said, you don't need Windows at all. Perhaps the confusion is that you're used to working with microcontrollers like Arduino, where you do compile code on another computer. The Raspberry Pi isn't a microcontroller, it's a complete computer in and of itself. Just do the work on the Pi and all will be well. (As mentioned in an answer below, you can use another computer to access your Pi with VNC or ssh. In that case, the other computer is acting as nothing more than a terminal.) – Bob Brown Jan 16 at 16:48

This site provided the answer I needed to my GPIO problem. https://www.caretech.io/2018/01/20/using-the-rpi-gpio-module-with-python-3/

I was getting the error: "ModuleNotFoundError: No module named 'RPi'"

To fix the problem, run: sudo apt install python3-rpi.gpio on the Raspberry Pi.

My setup is Raspberry Pi running Raspbian Lite as a headless server. I use Windows 10 to access the Pi over the network. I'm developing code for Python3. I use Github to store my code and Visual Studio Code as my development environment. This works for me so I can push code changes to Github and then pull those changes down to the Pi.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.