Question
Hello, I'm relatively new to uv.
I cloned a git repo of mine to begin with, and then uv init'ed within the folder. This initialized the usual files (pyproject.toml, main.py, uv.lock, etc.).
However, at this point, the Python version picked up in .python-version was the default one in my usr/bin/python which was Python 3.9.
I wanted instead for it to install and use Python 3.10 for this project.
Thus, I ran the following:
uv python install 3.10
uv python pin 3.10
Now, as expected this change is reflected in the .python-version file (which displays 3.10). However, the pyproject.toml and uv.loc files still show the old info.
pyproject.toml:
requires-python = ">=3.9"
uv.lock:
version = 1
revision = 2
requires-python = ">=3.9"
Questions:
- Do I manually need to change the values for requires-python in the above 2 files after doing
uv python pin 3.xx? Is that even required? If so, why is that not taken care of by the pin command?
- As I understand it,
uv python install 3.10 will install that Python version globally? Is there any way to install python only for this project / associated environment? I do not wish to pollute the global space with multiple Python versions.
As I am new, I may have some incorrect assumptions. So please correct me where needed.
uv has been a fantastic tool so far, so kudos to the community!
Thank you!
Platform
macOS Sequoia 15.5 (Darwin 24.5.0 arm64)
Version
uv 0.8.2 (21fadbc 2025-07-22)
Question
Hello, I'm relatively new to uv.
I cloned a git repo of mine to begin with, and then
uv init'ed within the folder. This initialized the usual files (pyproject.toml, main.py, uv.lock, etc.).However, at this point, the Python version picked up in .python-version was the default one in my
usr/bin/pythonwhich was Python 3.9.I wanted instead for it to install and use Python 3.10 for this project.
Thus, I ran the following:
uv python install 3.10uv python pin 3.10Now, as expected this change is reflected in the .python-version file (which displays 3.10). However, the pyproject.toml and uv.loc files still show the old info.
pyproject.toml:
uv.lock:
Questions:
uv python pin 3.xx? Is that even required? If so, why is that not taken care of by the pin command?uv python install 3.10will install that Python version globally? Is there any way to install python only for this project / associated environment? I do not wish to pollute the global space with multiple Python versions.As I am new, I may have some incorrect assumptions. So please correct me where needed.
uv has been a fantastic tool so far, so kudos to the community!
Thank you!
Platform
macOS Sequoia 15.5 (Darwin 24.5.0 arm64)
Version
uv 0.8.2 (21fadbc 2025-07-22)