Skip to content

Instantly share code, notes, and snippets.

@satorunooshie
Created April 21, 2025 19:41
Show Gist options
  • Select an option

  • Save satorunooshie/3e52ee26a07e804281c3a1a543ef08d2 to your computer and use it in GitHub Desktop.

Select an option

Save satorunooshie/3e52ee26a07e804281c3a1a543ef08d2 to your computer and use it in GitHub Desktop.
create openai lambda layer
mkdir -p lambda-layer/python && \
pip3 install \
--platform manylinux2014_x86_64 \
--target=lambda-layer/python \
--implementation cp \
--python-version 3.11 \
--only-binary=:all: \
--no-deps \
openai>=1.0.0 \
pydantic>=2.0.0 \
pydantic_core>=2.0.0 \
typing_extensions>=4.0.0 \
typing_inspection \
httpx>=0.24.1 \
anyio>=3.0.0 \
sniffio>=1.1 \
distro>=1.7.0 \
certifi>=2023.7.22 \
annotated-types>=0.5.0 \
h11>=0.14.0 \
idna>=2.8 \
httpcore>=1.0.0 \
jiter>=0.1.0 && \
cd lambda-layer && \
zip -r ../openai_layer.zip python && \
cd .. && \
rm -rf lambda-layer
@satorunooshie
Copy link
Author

satorunooshie commented Apr 21, 2025

Fixes these errors.

[ERROR] Runtime.ImportModuleError: Unable to import module 'main': No module named 'pydantic_core._pydantic_core'
Unable to import module 'main': No module named 'jiter.jiter'
[ERROR] Runtime.ImportModuleError: Unable to import module 'main': No module named 'typing_inspection'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment