No module named 'ti_image' in TI-nspire CX II python

130 views Asked by At

this is a question specific to the Ti-nspire's python library, but there isn't a tag specifically for it.

I'm trying to use its ti_image module, which to my knowledge should be pre-installed on the calculator like all of the other modules that work fine. However, when I try to import it with from ti_image import *, it gives my an import error saying there is no module named ti_image. Nothing in the official docs indicated that I need to download it somewhere or do something special just for this module. Is it somehow not preinstalled on my calculator? And if so, is there a way for me to install it now?

Here is the snippet of code that causes this problem:

# Works fine
from ti_draw import *

# Error: No module named ti_image
from ti_image import *

img = new_image(50,50,(255,255,255))

# ... rest of program

Again, this is on my TI-Nspire CX II, thanks.

1

There are 1 answers

2
Logan Tischler On

You're probably looking for the module ti_draw, which has the function draw_line, so it would be something like this:

from ti_draw import *

def set_pixel(x, y, r, g, b):
    set_color(r, g, b)
    draw_line(x, y, x, y)

set_pixel(10, 20, 255, 0, 0)