3
1

More than 1 year has passed since last update.

poetryのバージョンを指定してインストールする

Last updated at Posted at 2022-08-31

はじめに

Poetry 1.2.0が本日(2022/8/31)リリースされました。筆者の環境ではDocker上などでインストールエラーが発生するようになったので1.1を指定してインストールする方法についてまとめます。

How to

ローカルでのインストールは以下のようになります。POETRY_VERSIONはInstallしたいバージョンに適宜変更してください。

# この辺は .bashrc系に書くと良さそう
export POETRY_HOME="/opt/poetry"
export POETRY_VERSION=1.1.14
export PATH="$POETRY_HOME/bin::$PATH" 
curl -sSL https://install.python-poetry.org | python3 -

Dockerで書く場合は以下のような感じです。

ENV POETRY_HOME="/opt/poetry" \
    POETRY_VERSION=1.1.14
ENV PATH="$POETRY_HOME/bin::$PATH"
RUN curl -sSL https://install.python-poetry.org | python3 -

ちなみに本記事は以下のレポジトリのDockerfileと公式ドキュメントのインストール方法を参考にしています。docker上でのPoetryの書き方かかなり詳しく書かれており参考になります。

3
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
3
1