A
A
alxxla2020-02-06 17:43:19
Python
alxxla, 2020-02-06 17:43:19

Python: can't open file [errno 2] no such file or directory how to solve?

5e3c259cbf668232748282.png

Code in file
import requests

url = " https://www.google.com/ "
response = requests.get(url)
print(f"Requests to {url}. Status code is {response.status_code}")

How to solve this problem?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
B
B14, 2020-05-30
@alxxla

I had the same problem. And it consisted in the fact that I saved the python file in the wrong folder.
Just carefully review the location of the file that cannot be opened. Good luck!

A
Andrey, 2020-02-06
@anerev

Perhaps "python http_requests" ?

M
Maxim K, 2020-02-06
@mkvmaks

Replace in file path / with //

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question