I am having some problems with guizero(I'm a beginner). Every time I try to resize an Image an error pops up.
I installed pip with cmd and everything seemed fine(Newest pip version, newest python version). Imports:
#Imports---------
from guizero import App, TextBox, Drawing, Combo, Slider, Text
from tkinter import*
Here is a sample of code with some context:
def draw_photo():
photo.clear()
print('path.value:', path.value, end='\n\n')
if path.value[0:1] == '\'' or path.value[0:1] == '\"':
path_better = path.value[1:]
else:
path_better = path.value
print('path_better:', path_better, end='\n\n')
if path_better[len(path_better)-1:] == '\'' or path_better[len(path_better)-1:] == '\"':
path_correct = path_better[:len(path_better)-1]
else:
path_correct = path_better
print('path_correct:', path_correct, end='\n\n')
photo.image(0, 0, path_correct, width=1000, height=600)
photo.text(
20, 20, top_text.value,
color=top_color.value,
size=top_size.value,
font=top_font.value,
)
photo.text(
20, 320, bottom_text.value,
color=bottom_color.value,
size=bottom_size.value,
font=bottom_font.value,
)
The following line causes an error:
photo.image(0, 0, path_correct, width=1000, height=600)
This error pops up:
------------------------------------------------------------
*** GUIZERO WARNING ***
Image resizing - cannot scale the image as PIL is not available.
------------------------------------------------------------
Edit: After removing one python installation (I had one from Microsoft Store and another one, which I downloaded from python.org. I removed the one from Microsoft Store), the problem remains. But when running pip install --upgrade Pillow
in cmd, cmd now reports an error:
Der Befehl "pip" ist entweder falsch geschrieben oder
konnte nicht gefunden werden.
So it basically reports: 'The command "pip" is either being misspelled or could not be found '. I run the code by right-clicking on the file in Windows Explorer, selecting 'Edit with IDLE' and running it with F5, or by clicking on 'Run'.
It would be awesome if someone could help me.
Thanks in advance