LoginSignup
0
0

asdf, python環境構築手順メモ

Posted at

環境

  • OS: windows11, WSL(Ubuntu 22.04.2 LTS)
  • バージョン管理: asdf v0.13.1
  • 仮想環境、パッケージ管理: poetry version 1.1.14

手順

asdfでpythonをインストール

  1. WSL上のubuntuで依存関係をインストール
sudo apt update; sudo apt install build-essential libssl-dev zlib1g-dev \
libbz2-dev libreadline-dev libsqlite3-dev curl \
libncursesw5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev
  1. adsfのpythonプラグインをインストール
asdf plugin-add python
  1. python環境構築
    プロジェクトディレクトリ上で実行
echo 'python 3.11.3' > .tool-versions \
asdf install \

asdfでPoetryをインストール

  1. asdfでPoetryのインストール
asdf plugin-add poetry

Poetryでプロジェクトの初期化

  1. プロジェクトの初期化
poetry init
  1. pythonのパッケージを当該ディレクトリ以下に置く
poetry config virtualenvs.in-project true --local
  1. Poetryで使うpythonの指定
poetry env use <xxx>
0
0
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
0
0