python - Python 3.7:将代理应用于 pip 安装的所有部分,无法维护代理变量
问题描述
我有以下问题,我正在使用命令
pip install pyinstaller --proxy=http://webdefence.global.blackspider.com:80 --trusted-host=pypi.python.org
我遇到的问题是代理变量没有通过安装过程维护。尝试安装 setuptools 时,它不再具有代理地址。我试过在我的环境变量中使用HTTP_PROXY
and ,但没有成功。HTTPS_PROXY
还有其他方法可以设置将通过 pip 安装维护的代理吗?
我使用 -vvv 来生成更多错误细节 - 粘贴在 gist.github.com/blaggrob/19e7afcae2b4f1d36139fbf0a88a6651
Collecting pyinstaller
Using cached https://files.pythonhosted.org/packages/03/32/0e0de593f129bf1d1e77eed562496d154ef4460fd5cecfd78612ef39a0cc/PyInstaller-3.4.tar.gz
Installing build dependencies ... error
Complete output from command c:\users\blaggr\appdata\local\programs\python\python37-32\scripts\python.exe -m pip install --ignore-installed --no-user --prefix C:\Users\blaggr\AppData\Local\Temp\pip-build-env-vd3w15r1 --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple --trusted-host pypi.python.org -- setuptools wheel:
Collecting setuptools
Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='pypi.org', port=443): Read timed out. (read timeout=15)")': /simple/setuptools/
Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='pypi.org', port=443): Read timed out. (read timeout=15)")': /simple/setuptools/
Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='pypi.org', port=443): Read timed out. (read timeout=15)")': /simple/setuptools/
Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='pypi.org', port=443): Read timed out. (read timeout=15)")': /simple/setuptools/
Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='pypi.org', port=443): Read timed out. (read timeout=15)")': /simple/setuptools/
Could not find a version that satisfies the requirement setuptools (from versions: )
No matching distribution found for setuptools
解决方案
您可能遇到了新的PEP 518 支持实现的错误,其中为安装构建时依赖项而创建的隔离构建环境缺少必要的代理配置。
--no-build-isolation
您可以通过在命令行中使用、no-build-isolation=no
在配置文件中设置或通过设置环境变量来绕过新功能PIP_NO_BUILD_ISOLATION=no
(是的,最后两个选项是违反直觉的)。
这确实需要,setuptools
然后wheels
在您可以安装之前已经安装pyinstaller
。
我已经向该项目提交了一个新问题pip
来跟踪这个问题,我不相信它以前曾被报道过。
推荐阅读
- wix - 如何从 wix 项目中获取源路径/目标路径对的列表
- java - 使用spring kafka将文件作为byteArray发送到kafka
- nginx - 如何将此 Apache 代码转换为在 NGINX 中工作?
- android - react run android显示“babel:config:config-chain”错误并且不运行应用程序
- php - 消息:不能在 CodeIgnitor 中使用 stdClass 类型的对象作为数组
- google-analytics - 您可以通过报告 API 获得“会话质量”吗?
- python-3.x - 如何从 os.listdir 将文件名放入数组中
- xamarin.android - Activity.FragmentManager 已过时
- dji-sdk - Matrice600pro起落架如何用osdk控制?
- python - 如何使用 Python 将 Jinja2 传递给 HiveQL