I am trying to display LaTex. I want to create a python project with Tkinter where the user enters an equation and receives a solution. For this I'm trying to learn how to use LaTex.
I copied this code from another question on StackOverflow:
import sympy as sp
import tkinter as tk
from io import StringIO, BytesIO
from PIL import Image, ImageTk
x,y = sp.symbols('x,y')
expr = sp.sin(sp.sqrt(x**2 + 20)) + y
f = BytesIO()
sp.preview(expr, viewer='BytesIO', outputbuffer=f)
f.seek(0)
root = tk.Tk()
img = Image.open(f)
pimg = ImageTk.PhotoImage(img)
lbl = tk.Label(image=pimg)
lbl.pack()
root.mainloop()
I downloaded MikTex, but I still receive this error -
RuntimeError: latex program is not installed
I run my code with pycharm. How can I fix this? any ideas ?