mise
mise copied to clipboard
Creating a venv with uv does not use the correct python version
Hello,
First, thanks for the great tool, I have been using it and advising people to use it for quite some time, it is really valuable ! I regularly update the tool via cargo install-update
, and it seems I have been bitten by using the latest version.
Describe the bug
When setting a new python project, I want mise
to create and activate the virtual env for me, using the version given in .mise.toml
. It used to work fine.
The latest version seems to use uv
to create the virtual env, resulting in the wrong python version being installed.
To Reproduce
With the setting python.venv_stdlib
as false
, and with the following .mise.toml
[env]
_.file = ".env"
_.python.venv = { path = ".venv", create = true }
[tools]
python = { version = "3.10" }
When I enter the directory with no .venv
created, this is what I see:
mise creating venv with uv at: ~/REDACTED/.venv
Using CPython 3.11.10
Creating virtual environment at: .venv
Activate with: source .venv/bin/activate.fish
Notice the using CPython 3.11.10
when I want python 3.10
as per the .mise.toml
file.
Moreover, I do not have the pip
binary in the virtualenv. Manually activating the env does not change it.
$ python -V
Python 3.11.10
$ which pip
/HOME/.local/share/mise/installs/python/3.10.13/bin/pip
$ source .venv/bin/activate.fish
$ which pip
/HOME/.local/share/mise/installs/python/3.10.13/bin/pip
If I change the setting python.venv_stdlib
as true
, then I have the correct behavior (though, the creation is slower because it does not use uv
anymore)
$ mise settings set python.venv_stdlib true
$ rm -rf .venv
mise creating venv with stdlib at: REDACTED/.venv
$ which python
REDACTED/.venv/bin/python
$ python -V
Python 3.10.13
$ which pip
REDACTED/.venv/bin/pip
Expected behavior I'd like to create the virtualenv with uv and having the correct python version installed in the virtual environment.
I have uv
installed externally of the project, using pipx
and python version 3.12
if that matters.
Setting python.uv_venv_auto
does not seem to change as this project does not use uv.lock
.
mise doctor
output
version: 2024.11.37 linux-x64 (7ac5ab3 2024-11-30)
activated: yes
shims_on_path: no
build_info:
Target: x86_64-unknown-linux-gnu
Features: DEFAULT, NATIVE_TLS, OPENSSL
Built: Sat, 30 Nov 2024 01:03:00 +0000
Rust Version: rustc 1.82.0 (f6e511eec 2024-10-15)
Profile: release
shell:
/usr/bin/fish
fish, version 3.7.1
dirs:
cache: ~/.cache/mise
config: ~/.config/mise
data: ~/.local/share/mise
shims: ~/.local/share/mise/shims
state: ~/.local/state/mise
config_files:
~/.config/mise/config.toml
~/REDACTED/.mise.toml
backends:
aqua
asdf
cargo
core
gem
go
npm
pipx
spm
ubi
vfox
plugins:
chezmoi https://github.com/joke/asdf-chezmoi.git#53f30be
go https://github.com/kennyp/asdf-golang.git#d4f1d65
haskell https://github.com/asdf-community/asdf-haskell.git#499d84c
java https://github.com/rtx-plugins/rtx-java.git#6c6790c
jq https://github.com/azmcode/asdf-jq.git#a13dea7
meson https://github.com/asdf-community/asdf-meson.git#212ecdb
ninja https://github.com/asdf-community/asdf-ninja.git#e196e02
yarn https://github.com/twuni/asdf-yarn.git#376c540
toolset:
core:[email protected]
env_vars:
MISE_SHELL=fish
settings:
experimental true ~/.config/mise/config.toml
python.uv_venv_auto true ~/.config/mise/config.toml
python.venv_stdlib false ~/.config/mise/config.toml
2 warnings found:
1. plugin go overrides a core plugin
2. plugin java overrides a core plugin
No problems found
Additional context I use ubuntu 20.04.