我尝试使用AWS EC2 Ubuntu构建容器映像,以便为需要www.example.com库的python脚本推送AWS ECR Repository。但是,它向我抛出了一个错误,我不确定如何修复。我使用AWS ECR推送命令来完成此操作。web3.py library. However, it is throwing me an error that I'm not sure how to fix. I am using AWS ECR push commands to do it.
命令为:docker build -t docker-lambda
.
我的停靠文件:
FROM public.ecr.aws/lambda/python:3.8
COPY requirements.txt ./
RUN pip3 install -r requirements.txt
COPY app.py ./
CMD ["app.lambda_handler"]
requirements.txt:
web3
错误信息:
error: subprocess-exited-with-error
× Running setup.py install for lru-dict did not run successfully.
│ exit code: 1
╰─> [9 lines of output]
running install
running build
running build_ext
building 'lru' extension
creating build
creating build/temp.linux-x86_64-3.8
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/var/lang/include/python3.8 -c lru.c -o build/temp.linux-x86_64-3.8/lru.o
unable to execute 'gcc': No such file or directory
error: command 'gcc' failed with exit status 1
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure
× Encountered error while trying to install package.
╰─> lru-dict
note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.
1条答案
按热度按时间kmbjn2e31#
构建这个lru-dict需要一些c包和库。安装gcc工具:
沿着用于开发的Python工具:
在容器里也试一试...这个应该能用