Answer the question
In order to leave comments, you need to log in
Why do different code editors treat paths differently?
I open the project in pycharm, everything works fine:
I open the same project in visualcode, it gives an error:
Image.open('test_images/pfdVxnWc1ww.jpg')
File "C:\Users\user\anaconda3\lib\site-packages\PIL\Image.py", line 2809, in open
fp = builtins.open(filename, "rb")
FileNotFoundError: [Errno 2] No such file or directory: 'test_images/pfdVxnWc1ww.jpg'
Answer the question
In order to leave comments, you need to log in
First, neither pycharm nor visualcode are editors. It's an IDE. And when working IN EACH of them, you need to configure the environment and the working directory. Start with the last one - setting up the working directory. Or explicitly specify the full path to your object.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question