I'm using a Raspberry Pi Pico and an ili9341 touchscreen. To the codes below;

import machine
import ili9341

# Set up the SPI bus
spi = machine.SPI(0, baudrate=10000000, miso=machine.Pin(16), mosi=machine.Pin(19), 

# Set up the LCD display
lcd = ili9341.ILI9341(spi, 240, 320, cs=machine.Pin(17), dc=machine.Pin(20))

# Clear the screen

# Write "Hello World" to the screen
lcd.write("Hello World")

# Display the screen

i am getting this error: Traceback (most recent call last): File "", line 8, in AttributeError: 'module' object has no attribute 'ILI9341'

I downloaded the .py file in the link. https://github.com/rdagger/micropython-ili9341/blob/master/ili9341.py

  • 2
    I’m voting to close this question because in effect it is a duplicate of raspberrypi.stackexchange.com/questions/143129/…
    – joan
    May 15 at 16:56
  • 1
    @joan I asked for the code and circuit diagram in the previous thread, but I couldn't find the answer I wanted. Now I'm getting an error and I opened this thread to resolve it.
    – MEnsar55
    May 15 at 17:01
  • 1
    You should have supplied the information requested for the original question. You are wasting your time and our time.
    – joan
    May 15 at 17:18
  • 1
    @joan I just want to print "Hello World" to the screen. This much.
    – MEnsar55
    May 15 at 17:51
  • 1
    @joan I'm sorry for taking up your time.
    – MEnsar55
    May 15 at 19:09

1 Answer 1


I think the error is occurring due to an installation problem with ili9341. Make sure that you have downloaded and installed the ili9341 library properly.

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.