命令:
\npip install -r requirements.txt\nRun Code Online (Sandbox Code Playgroud)\n输出:
\nerror: externally-managed-environment\n\n\xc3\x97 This environment is externally managed\n\xe2\x95\xb0\xe2\x94\x80> To install Python packages system-wide, try apt install\npython3-xyz, where xyz is the package you are trying to\ninstall.\n\nIf you wish to install a non-Debian-packaged Python package,\ncreate a virtual environment using python3 -m venv path/to/venv.\nThen use path/to/venv/bin/python and path/to/venv/bin/pip. Make\nsure you have python3-full installed.\n\nIf you wish to install a non-Debian packaged Python application,\nit may be easiest to use pipx install xyz, which will manage a\nvirtual environment …Run Code Online (Sandbox Code Playgroud) 我使用的是 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. …Run Code Online (Sandbox Code Playgroud)