简体   繁体   English

在 tox.ini 中为 tox 设置代理

[英]Setup proxy for tox in tox.ini

I'm a newbie in the tox library.我是毒物图书馆的新手。 I failed to run tox我没有运行 tox 在此处输入图像描述

and this is my tox.ini这是我的 tox.ini 在此处输入图像描述

It seems the proxy configuration is failed.似乎代理配置失败。 在此处输入图像描述

Please help me.请帮我。 Thanks in advance提前致谢

I never had to use a proxy for tox / pip , but after reading https://leifengblog.net/blog/how-to-use-pip-behind-a-proxy/ I would suggest to try two things...我从来不需要使用代理tox / pip ,但在阅读https://leifengblog.net/blog/how-to-use-pip-behind-a-proxy/之后,我建议尝试两件事......

a) lower case the environment variable to https_proxy a) 将环境变量小写为https_proxy

b) pass in the proxy command to pip similar like sudo pip install --proxy=https://[username:password@]proxyserver:port somepackage b)将代理命令传递给pip类似于sudo pip install --proxy=https://[username:password@]proxyserver:port somepackage

I'd go with the second approach, as one commenter in above blog post mentioned the environment variable approach did not work for him on Linux.我会用第二种方法 go,因为上面博客文章中的一位评论者提到environment variable approach在 Linux 上对他不起作用。

Also see here the official pip documentation .另请参阅此处的 官方 pip 文档

I am the author/maintainer of the tox.我是毒药的作者/维护者。 If you're using tox 3.14.4 or later you don't need to specify the environment variables - see https://github.com/tox-dev/tox/commit/33fd18be87ba9eed85f7767e20abce0c90fffe4e如果您使用的是 tox 3.14.4 或更高版本,则无需指定环境变量 - 请参阅https://github.com/tox-dev/tox/commit/33fd18be87ba9eed85f7767e20abce0c90fffe4e

You should not need to change anything with a recent version of pip/tox.您不需要使用最新版本的 pip/tox 进行任何更改。 I'm using tox from behind a proxy on a daily basis.我每天都在代理后面使用毒药。

I can install the library using pip with proxy but cannot with tox我可以使用 pip 和代理安装库,但不能使用 tox

Can you detail both of these?你能详细说明这两个吗? How you do it?你是怎么做到的?

PS. PS。 We have a discord chat if you'd like a more interactive help channel https://discord.gg/tox如果您想要一个更具互动性的帮助频道https://discord.gg/tox ,我们有一个 discord 聊天

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM