Poetry
Poetryはpythonのモジュール/パッケージ管理ツールです.
最近 pipenv の代わりに使い始めました.
参考)https://org-technology.com/posts/python-poetry.html
普段手元でサクッとコードを書くぶんには、特段Poetryの便利さは体感できてないです(pipenvとそんなに変わらない)
パッケージ配布とかをするのであれば、恩恵があるのかなと思っています.
Poetryのインストール先
Poetryの設定やコマンドからpythonのインストール先がサクッとわかるのかなと思ったら、少し探したので覚書き的に書いておきます.
私の場合、以下のpathでインストールされていました.
ls ~/Library/Caches/pypoetry/virtualenvs/dev-py3.6/bin/python
dev-py3.6
の部分はインストールしたpythonのバージョンによって異なるはずです.
こちらのパスを Pycharmの Project:Interpreter
に設定しましょう.
Pycharmの設定
Pycharmでは御存知の通り Project:Interpreter
の設定からPythonモジュールを読み込みます.
PoetryがインストールするPythonを指定しないと、Pycharmに Unresolved Reference 'hogehoge'
で怒られてしまいます.
-
PyCharm -> Preference -> Project:Workspace -> Porject Interpreter
と進みます.
-
Existing environmentにチェック. パスからPoetryのインストールしたPythonの選択します.


- OKを押してダイアログを閉じると、設定が反映されます.

おまけ
私のよく使うpoetryコマンド(alias)
# poetry
alias po='poetry'
alias poa='poetry add'
alias poc='poetry config'
alias por='poetry run'
alias porm='poetry remove'
alias pos='poetry show'