Hello i am fairly new in python. Everything was going smoothly until i tried to use PIL, i have been stuck on this for a few days so if you can help it will be very good.
<code>
`import PIL
from PIL import Image
fp = Image.open(r"C:UsersUserDownloads.png")
im.show()
</code>
<code>
`import PIL
from PIL import Image
fp = Image.open(r"C:UsersUserDownloads.png")
im.show()
</code>
`import PIL
from PIL import Image
fp = Image.open(r"C:UsersUserDownloads.png")
im.show()
i have also tried diffrent ways like :
<code>import PIL
from PIL import Image
file_name="C:UsersUserDownloads.png"
fp = Image.open(file_name,"r")
im.show()
``
which has shown SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated UXXXXXXXX escape
i have also changed it to : file_name="C:\Users\User\Downloads.png" but it shows another error
but it mostly shows :Traceback (most recent call last):
File "C:UsersUserpythonProject.venvimage 0.1.py", line 4, in <module>
fp = Image.open(file_name,"r")
^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:UsersUserpythonProject.venvLibsite-packagesPILImage.py", line 3431, in open
fp = builtins.open(filename, "rb")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: 'C:\Users\User\Downloads.png'
i am in a windows and use pycharm if you can help it will be amazing ,
Thank you
</code>
<code>import PIL
from PIL import Image
file_name="C:UsersUserDownloads.png"
fp = Image.open(file_name,"r")
im.show()
``
which has shown SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated UXXXXXXXX escape
i have also changed it to : file_name="C:\Users\User\Downloads.png" but it shows another error
but it mostly shows :Traceback (most recent call last):
File "C:UsersUserpythonProject.venvimage 0.1.py", line 4, in <module>
fp = Image.open(file_name,"r")
^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:UsersUserpythonProject.venvLibsite-packagesPILImage.py", line 3431, in open
fp = builtins.open(filename, "rb")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: 'C:\Users\User\Downloads.png'
i am in a windows and use pycharm if you can help it will be amazing ,
Thank you
</code>
import PIL
from PIL import Image
file_name="C:UsersUserDownloads.png"
fp = Image.open(file_name,"r")
im.show()
``
which has shown SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated UXXXXXXXX escape
i have also changed it to : file_name="C:\Users\User\Downloads.png" but it shows another error
but it mostly shows :Traceback (most recent call last):
File "C:UsersUserpythonProject.venvimage 0.1.py", line 4, in <module>
fp = Image.open(file_name,"r")
^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:UsersUserpythonProject.venvLibsite-packagesPILImage.py", line 3431, in open
fp = builtins.open(filename, "rb")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: 'C:\Users\User\Downloads.png'
i am in a windows and use pycharm if you can help it will be amazing ,
Thank you
New contributor
VAN is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.