2

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()
try:
        id,text = reader.read()
        print(text)
finally:
        GPIO.cleanup()

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

Adnan Farooqui
  • 101
  • 2
  • 8

1 Answers1

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

Adnan Farooqui
  • 101
  • 2
  • 8