Python docker构建

2024-04-19 23:52:07 发布

您现在位置:Python中文网/ 问答频道 /正文

我在运行命令时遇到这个错误

sudo docker-compose up

Docker文件:

^{pr2}$

为了解决这个问题,我尝试安装以下软件包

1)gcc包。在

2)libffi包。在

3)pip openssl包。在

但错误仍然没有解决。任何帮助都应该感谢


Tags: pip文件composedocker命令错误sudogcc
1条回答
网友
1楼 · 发布于 2024-04-19 23:52:07

尝试建议的解决方案here

This is because you need a working compiler, the easiest way around this is too install the build-base package like so:

apk add no-cache virtual .pynacl_deps build-base python3-dev libffi-dev This will install various tools that are required to compile pynacl and pip install pynacl will now succeed.

Note it is optional to use the virtual flag but it makes it easy to trim the image because you can run apk del .pynacl_deps later in your dockerfile as they are not needed any more and would reduce the overall size of the image.

相关问题 更多 >