In Containerumgebungen, z. Datenbleal-Jobcluster mussten ein Python-Rad (z. B. my_package-1.0.0-py3-none-an -any.wl ) mit PIP -Resolved-Abhängigkeiten über einen Proxy installieren. Der Proxy sollte nur auf PIP Server anwenden, nicht auf den gesamten Datenverkehr (z. B. Funken Jobs, S3 Datenzugriff oder Container -Netzwerk), aber die Standard -Ansätze [ Einstellung http_proxy ] beeinflussten alles und erzwingen alles, was den gesamten Amxy über proxy. />
[*] Umgebungen : Docker , Kubernetes , Databricks usw.
Anwendungsfall : Resolve -Radabhängigkeiten über PIP mit einem Proxy (E.G., Http: // {{code {{{{{} ({} (}) (E.G., Http: // {{{{{{} (} ({G., http: http: // {{{{{{}) (E.G., Http: // {{{{{{} (} ({g. Ausschluss von Hosts wie .
Code: Select all
PIP_PROXY
Allgemeine Konfiguration
Code: Select all
PIP_PROXY=http://{host}:{port} # e.g., http://proxy.example.com:3128
PIP_NO_PROXY= # e.g., localhost,127.0.0.1
< /code>
Beispiele < /h3>
Docker < /h4>
docker run --rm \
-e PIP_PROXY=http://{host}:{port} \
-e PIP_NO_PROXY= \
python:3.9 pip install my_package-1.0.0-py3-none-any.whl
< /code>
Kubernetes < /h4>
apiVersion: v1
kind: Pod
metadata:
name: pip-pod
spec:
containers:
1. name: python
image: python:3.9
command: ["pip", "install", "my_package-1.0.0-py3-none-any.whl"]
env:
- name: PIP_PROXY
value: "http://{host}:{port}"
- name: PIP_NO_PROXY
value: ""
< /code>
Datenbleal [meine Anwendungsschule] < /H3>
In erweiterten Optionen> Spark> Umgebungsvariablen: < /li>
< /ol>
PIP_PROXY=http://{host}:{port}
PIP_NO_PROXY=
< /code>
Installieren Sie Bibliotheken über UI < />
cluster neu. Http_proxy = http: // {host}: {port}