Python Anaconda代理" .condarc"文件

时间:2016-10-10 20:02:44

标签: python proxy anaconda

我是Python的初学者,稍微熟悉一下R.我的背景是关于数学而不是编程,那么与核心系统等有关的一切对我来说通常听起来很奇怪!

我在公司防火墙后面工作,最近我解决了R& S的问题。 Rstudio创建了一个" .Renviron"包含代理标识+我的用户名和密码的文件。 我正在努力为Python&做同样的事情。 Anaconda创建了一个" .condarc"文件!

以下是我在之前看过的Stackoverflow的2篇文章:
- Python Anaconda Proxy Setup via .condarc file on Windows
- Unable to update conda packages behind corporate firewall. Updated .condarc file, proxy settings still it is asking for Proxy user name and password
不幸的是,它并没有真正帮助我,最后它还没有在我的电脑上工作。我想在我的电脑上只做了一点小改动,但是哪一个?...

此外,我还想提及以下内容适用于Python笔记本:

import requests  
proxies = {  
    'http': 'http://myname:mypwd@proxy-blabla.fr:8080',  
    'https': 'https://myname:mypwd@proxy-blabla.fr:8080'  
}  
requests.get('http://example.org', proxies=proxies)  
#Note: "myname" is indeed something like "abc\\def"

但我必须在每个脚本中编写它+它不允许我运行任何脚本,如urllib.request.urlopen()等,然后重新使用我可以在stackoverflow等中找到的代码。

有什么建议吗?为什么以下" .condarc"没有"工作" ?

channels:  
  - r  
  - defaults  
proxy_servers:  
    http: http://myname:mypwd@proxy-blabla.fr:8080  
    https: https://myname:mypwd@proxy-blabla.fr:8080

注意:我正在使用:
- conda 4.1.6
- python 3.5.2
- os:Windows 7 Enterprise 64位

0 个答案:

没有答案