ERROR
pip
config_error
ai_generated
true
ERROR: Option '--trusted-host' is not allowed in the pip.conf file. Use the format: trusted-host = pypi.org files.pythonhosted.org
ID: pip/pip-conf-option-error
95%Fix Rate
90%Confidence
1Evidence
2023-04-10First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| pip 22.3 | active | — | — | — |
| pip 23.0 | active | — | — | — |
| pip 23.2 | active | — | — | — |
Root Cause
The pip configuration file (pip.conf/pip.ini) contains command-line-style options (e.g., --trusted-host) instead of the correct INI-style key-value format.
generic中文
pip 配置文件(pip.conf/pip.ini)包含命令行样式的选项(如 --trusted-host),而不是正确的 INI 风格键值对格式。
Official Documentation
https://pip.pypa.io/en/stable/topics/configuration/Workarounds
-
95% success Edit pip.conf to use correct INI format: [global] trusted-host = pypi.org files.pythonhosted.org
Edit pip.conf to use correct INI format: [global] trusted-host = pypi.org files.pythonhosted.org
-
90% success Remove the offending lines and use environment variables instead: export PIP_TRUSTED_HOST="pypi.org files.pythonhosted.org"
Remove the offending lines and use environment variables instead: export PIP_TRUSTED_HOST="pypi.org files.pythonhosted.org"
-
85% success Validate config with: pip config list --global (or --user/--site) to see current effective settings.
Validate config with: pip config list --global (or --user/--site) to see current effective settings.
中文步骤
Edit pip.conf to use correct INI format: [global] trusted-host = pypi.org files.pythonhosted.org
Remove the offending lines and use environment variables instead: export PIP_TRUSTED_HOST="pypi.org files.pythonhosted.org"
Validate config with: pip config list --global (or --user/--site) to see current effective settings.
Dead Ends
Common approaches that don't work:
-
70% fail
This works temporarily but does not fix the config file; the error persists on next pip command reading the config.
-
90% fail
Still uses the CLI-style prefix; config expects bare key names without dashes.
-
50% fail
Removes the error but also removes all other valid configurations, potentially breaking other settings.