我正在尝试通过Docker运行API,但我遇到了以下问题:
27.47 error: externally-managed-environment
27.47
27.47 Ã This environment is externally managed
27.47 â°â>
27.47 The system-wide python installation should be maintained using the system
27.47 package manager (apk) only.
27.47
27.47 If the package in question is not packaged already (and hence installable via
27.47 "apk add py3-somepackage"), please consider installing it inside a virtual
27.47 environment, e.g.:
27.47
27.47 python3 -m venv /path/to/venv
27.47 . /path/to/venv/bin/activate
27.47 pip install mypackage
27.47
27.47 To exit the virtual environment, run:
27.47
27.47 deactivate
27.47
27.47 The virtual environment is not deleted, and can be re-entered by re-sourcing
27.47 the activate file.
27.47
27.47 To automatically manage virtual environments, consider using pipx (from the
27.47 pipx package).
27.47
27.47 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.
27.47 hint: See PEP 668 for the detailed specification.
------
failed to solve: process "/bin/sh -c apk update && apk add --no-cache python3 py3-pip && pip3 install pika google-cloud-bigquery python-dotenv pycryptodome" did not complete successfully: exit code: 1
事实上,直到上周,API在装有高山的集装箱拉高山的地方都能正常工作:最新。然而,当我放alpine:3.14版本时,上面的错误并没有出现,但这个版本不再受支持。
事实证明,当我离开3.14版本时,我可以在本地机器上运行API,但当我用alpine:3.14将同一个API上传到Jenkins时,它会停止工作,产生与我之前相同的错误,如上所示。
有人知道我忘了看什么或检查什么吗?
我尝试了3.15、3.16、3.17、3.18和3.19等高山版本,但它们都显示出与上述相同的错误。alpine的3.14版本有效,但它不再受支持,而且,即使它在我的本地机器上运行,当我在Jenkins中构建它时,它也会出错,并引用与上述相同的错误。