【发布时间】:2019-09-03 12:11:10
【问题描述】:
我在 Windows 10 上安装了 Python 3.7.3,但由于我公司的 Internet 代理,我无法在 Gitbash (Git SCM) 中通过 PIP 安装 Python 包。
我尝试通过以下方式为代理创建环境变量,但没有成功:
- 导出 http_proxy='proxy.com:8080'
- 导出 https_proxy='proxy.com:8080'
我找到了一个适合我的临时解决方案:将以下别名插入到 .bashrc 文件中:
- 别名 python='winpty python.exe'
- 别名 pip='pip --proxy=proxy.com:8080'
上述方法有效,但我正在寻找更好的解决方案,这样我就不需要为我使用的每个命令设置别名。我正在考虑类似环境变量的东西,但还没有找到如何在 Windows 的 git bash 环境中设置它。
你知道怎么做吗?
【问题讨论】:
标签: python-3.x windows proxy environment-variables git-bash