0
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Poetryでライブラリがインストールできない時の解決方法

Posted at

起こるエラー

poetryを使っていると、よく遭遇する

$ poetry config virtualenvs.in-project true 
$ poetry new project-name
$ poetry add lib-name

みたいにしたときに、以下みたいなエラーが出た時の解決方法

[SolverProblemError]
The current project's Python requirement (>=2.7,<2.8) is not compatible with some of the required packages Python requirement:
  - environs requires Python >=3.5

Because environs (7.1.0) requires Python >=3.5
 and no versions of environs match >7.1.0,<8.0.0, environs is forbidden.
So, because ops depends on environs (^7.1.0), version solving failed.

解決方法

poetry env use python-version

で解決しましょう。例えば、Python3.7を使いたい場合は、

poetry env use python3.7

と打てば、環境を再構築してくれるので次回以降エラーが出なくなるはずです。

0
2
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
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?