Skip to main content
Source Link
Karel Marik
  • 1.1k
  • 11
  • 16

Assuming your script folder absolute/path/to/ contains the uv environment then:

uv run --script "absolute/path/to/my_script.py"

executes the script with the uv default python executable (e.g. "C:\Users\USER_NAME\AppData\Roaming\uv\python\cpython-3.14.2-windows-x86_64-none\python.exe")

When running

uv run --directory "absolute/path/to/" my_script.py

then the same script is executed with python executable specified in the project uv configuration (e.g. absolute/path/to/.venv/Scripts/python.exe)