スキップしてコンテンツを表示

How to solve pydantic_core error?

0

I installed various libraries, including the pydantic library(pip install pydantic), in pycharm, created a zip file, and then added it to the lambda layer. But ERROR: Could not find a version that satisfies the requirement pydantic_core._pydantic_core (from versions: none) ERROR: No matching distribution found for pydantic_core._pydantic_core The above error was generated. Please help me!

質問済み 2年前2826ビュー
1回答
0

Hi,

Lambda requires packages built for a specific architecture. Many packages have distributions for multiple architectures (see https://pypi.org/project/pydantic-core/#files for pydantic-core). By default, pip installs the distribution suitable for the machine where you are running it on, which is not necessary the same architecture as your Lambda.

But you can force pip to install packages for the architecture you want. If your Lambda uses x86_64, then you should select platform manylinux2014_x86_64:

pip install pydantic-core --platform manylinux2014_x86_64 -t . --only-binary=:all:

-t . - means install in the current directory.

However, the best way is to install all your dependencies with the required platform, rather than doing it for each package.

pip install -r requirements.txt --platform manylinux2014_x86_64 --target ./python -

Credit to this answer: https://stackoverflow.com/questions/77210131/can-i-force-pip-to-install-dependencies-for-x86-64-architecture-in-powershell-to/77210143#77210143

Best,

Didier

エキスパート
回答済み 2年前
エキスパート
レビュー済み 2年前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

関連するコンテンツ