5
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

mise-en-placeとuvでPython環境をセットアップする

5
Last updated at Posted at 2024-08-14

これまでpyenv、venv、direnvでPython環境を用意していたのだが、mise-en-placeとuvへ乗り換えることにした。

そこで、プロジェクトで使用するPythonバージョンを指定し、仮想環境をセットアップする方法を記しておく。

# 使用するPythonバージョンの指定
echo 3.13 > .python-version

# 仮想環境の作成
mise use uv@latest
uv init

# venvディレクトリの登録
cat << EOF >> mise.toml

[env]
_.python.venv = ".venv"
EOF

# 手動で更新した mise.toml の有効化
mise trust
5
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?