[Python] Can't open file 'C:\\Users\\H\\Downloads\\Hossein-OH\\VSCODE\\main.py': [Errno 2] No...

Discussão em 'Python' iniciado por Stack, Maio 6, 2025.

  1. Stack

    Stack Membro Participativo

    I got this error today; previously I didn't get that. My python file is in "C:\Users\H\Downloads\Hossein-OH\VSCODE\PYTHON API\main.py" and this is the documentation

    from flask import Flask, Request, jsonify

    app = Flask(__name__)

    @app.route("/")
    def home():
    return "Home"

    if __name__ == "__main__":
    app.run(debug=True)


    I tried to run my code in VScode terminal with "python main.py" but I got this error:


    can't open file 'C:\Users\H\Downloads\Hossein-OH\VSCODE\main.py': [Errno 2] No such file or directory
    ​

    Continue reading...

Compartilhe esta Página