![](/img/trans.png)
[英]“Building wheel for lru-dict” and “Running setup.py install for lru-dict” error
[英]error: subprocess-exited-with-error × Running setup.py install for lru-dict did not run successfully
我正在尝试使用 AWS EC2 Ubuntu 构建容器映像,以推送 AWS ECR 存储库以获取需要 web3.py 库的 python 脚本。 但是,它给我带来了一个我不知道如何解决的错误。 我正在使用 AWS ECR 推送命令来执行此操作。
命令是: docker build -t docker-lambda
。
我的 Dockerfile:
FROM public.ecr.aws/lambda/python:3.8
COPY requirements.txt ./
RUN pip3 install -r requirements.txt
COPY app.py ./
CMD ["app.lambda_handler"]
要求.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.
构建这个 lru-dict 需要一些 c 包和库。 安装 gcc 工具:
sudo apt-get install build-essential
以及用于开发的 python 工具:
sudo apt-get install python3-dev
也可以在容器中尝试它们……这应该可以
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.