Nil*_*ili 0 docker docker-compose windows-subsystem-for-linux
我使用的是 Windows 机器,并且已经安装了 wsl 以便能够使用 Docker 桌面。当然构建失败了,然后我在dockerfile中观察到了python3和pip3。所以我通过 wsl 安装了 ubuntu 和 debian,然后尝试运行该应用程序(docker-compose up)。它仍然失败并抛出以下错误:
\n ERROR [test 3/5] RUN pip3 install daff==1.3.46                                                                                                                           0.9s\n------\n > [test 3/5] RUN pip3 install daff==1.3.46:\n0.812 error: externally-managed-environment\n0.812\n0.812 \xc3\x97 This environment is externally managed\n0.812 \xe2\x95\xb0\xe2\x94\x80> To install Python packages system-wide, try apt install\n0.812     python3-xyz, where xyz is the package you are trying to\n0.812     install.\n0.812\n0.812     If you wish to install a non-Debian-packaged Python package,\n0.812     create a virtual environment using python3 -m venv path/to/venv.\n0.812     Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make\n0.812     sure you have python3-full installed.\n0.812\n0.812     If you wish to install a non-Debian packaged Python application,\n0.812     it may be easiest to use pipx install xyz, which will manage a\n0.812     virtual environment for you. Make sure you have pipx installed.\n0.812\n0.812     See /usr/share/doc/python3.11/README.venv for more information.\n0.812\n0.812 note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.\n0.812 hint: See PEP 668 for the detailed specification.\n------\nfailed to solve: process "/bin/sh -c pip3 install daff==1.3.46" did not complete successfully: exit code: 1\n这是 DockerFile:
\nFROM postgres:12\n\nRUN apt-get update && apt-get install -y \\\n    python3 \\\n    python3-pip\nRUN pip3 install daff==1.3.46\n\n# Copy project files\nCOPY . /app\nWORKDIR /app\nENV PATH=$PATH:/app/bin\n知道如何解决这个问题吗?\n因为我正在使用 docker,所以每次使用 pip3 时如何解决“错误:外部管理环境”?对我没有帮助。
\n| 归档时间: | 
 | 
| 查看次数: | 4941 次 | 
| 最近记录: |