Results are not the same as Python tutoral

I am updating my knowledge of Python after a few years.

I am using an introductory course from Chapter 2: Setting Up Python 3.14 - 10xdev.blog

After installing Python and uv, the following instructions from the course notes are displayed

Let’s create a simple project to see uv in action.

  1. Create & Navigate: Open your terminal, go where you keep your projects, and run:

    uv init my_first_project
    cd my_first_project
    
    
    

    Copy & Open Playground

    uv init creates the folder and sets up essential files.

  2. Inspect: Look inside my_first_project. You’ll see:

    • pyproject.toml: The central configuration file for your project (dependencies, metadata). Think of it like package.json if you’ve used Node.js.
    • main.py: A basic entry point script.
    • .venv: A hidden folder – uv automatically created a virtual environment for you!
    • README.md: Standard documentation file.

After executing the instructions, I get the following at my command prompt

c:\Python files>cd my_first_project

c:\Python files\my_first_project>dir /a
Volume in drive C is Acer
Volume Serial Number is C604-F012

Directory of c:\Python files\my_first_project

26/08/2026 14:20 .
26/08/2026 14:20 ..
26/08/2026 14:20 5 .python-version
26/08/2026 14:20 393 pyproject.toml
26/08/2026 14:20 0 README.md
26/08/2026 14:20 src
3 File(s) 398 bytes
3 Dir(s) 372,996,489,216 bytes free

One of the hidden files is .venv, but there is no main.py.

The following is the next instructions

Run Your Code: You can run your script using uv run:

uv run main.py

If I do this I get the following results

c:\Python files\my_first_project>uv run main.py
error: Failed to spawn: main.py
Caused by: program not found

c:\Python files\my_first_project>uv run python main.py
C:\Python files\my_first_project.venv\Scripts\python.exe: can’t open file ‘c:\Python files\my_first_project\main.py’: [Errno 2] No such file or directory

c:\Python files\my_first_project>.venv\Scripts\activate.bat

(my-first-project) c:\Python files\my_first_project>python mai.py
python: can’t open file ‘c:\Python files\my_first_project\mai.py’: [Errno 2] No such file or directory

Please help

It appears that the tutorial you are following is out of date, and the main.py file is in the src directory, not in the top-level directory.

Thank you for your solution.

The default behavior of uv init has recently changed. For simple projects, like the ones in the tutorial, you can revert to the old behavior by using uv init --no-package instead of uv init, for example uv init --no-package my_first_project.