I am using RFID reader module (MFRC522) with my raspberry pi and when I run the script with python 2 it works fine and reads the RFID tag but when I run it with python3 I get an error - No Module named 'spi'

My script is -

import RPi.GPIO as GPIO
import SimpleMFRC522
reader = SimpleMFRC522.SimpleMFRC522()
        id,text = reader.read()

I need this to run with python3 because I am using Firebase in my project and it works with python3, not python2.7

  • 1
    have you tried installing SPI? pip3 install spi? Apr 2, 2019 at 7:49
  • Or you forgot the statement "import spidev".
    – tlfong01
    Apr 2, 2019 at 8:03

1 Answer 1


Turns out that the official package for the MFRC522 module was written in python2 and hence causing the issue. I found an updated package by a user on github and it works fine now. Github Link to the package

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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