Tyler Cordeiro
Tyler Cordeiro

Reputation: 11

Importing & manipulating images with PILLOW

I'm trying to use the python image library to import an image. I keep getting an error that says the file or directory doesn't exist when I run this code:

from PIL import Image 
img = Image.open("Users/tylercordeiro/hello/sunrisesunsettime.jpeg")

Am I doing anything wrong? Is there a specific way that I need to put in the name of my file/directory?

Upvotes: 1

Views: 41

Answers (1)

Kyv
Kyv

Reputation: 677

Try with an absolute path. I have added a / or slash at the beginning of the file name.

from PIL import Image 
im = Image.open("/Users/tylercordeiro/hello/sunrisesunsettime.jpeg")
im

Upvotes: 1

Related Questions