0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

poetry add langchainのエラー対応

Posted at

poetry add langchainを実行した際に以下のエラーが発生した場合の対処法
pythonのバージョンが範囲内なのにエラーでる。

The current project's supported Python range (>=3.11) is not compatible with some of the required packages Python requirement:
  - langchain requires Python <4.0,>=3.9, so it will not be satisfied for Python >=4.0

Because no versions of langchain match >0.3.7,<0.4.0
 and langchain (0.3.7) requires Python <4.0,>=3.9, langchain is forbidden.
So, because app depends on langchain (^0.3.7), version solving failed.
  • pyproject.tomlに記載されているバージョンを変更する
pyproject.toml
python = ">=3.11,<4.0"
numpy = "1=,<2"
  • pythonだけでなく、numpyなどのバージョンも変更する必要がある
  • pythonだけ対応すると以下のエラーが発生してようやく原因がわかる。
Because no versions of langchain match >0.3.7,<0.4.0
 and langchain (0.3.7) depends on numpy (>=1,<2), langchain (>=0.3.7,<0.4.0) requires numpy (>=1,<2).
So, because app depends on both numpy (^2.1.3) and langchain (^0.3.7), version solving failed.

以上

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?