【问题标题】:Errno 10060 using pandas.get_csv in EclipseErrno 10060 在 Eclipse 中使用 pandas.get_csv
【发布时间】:2015-08-14 20:35:31
【问题描述】:

我在代理服务器后面使用 eclipse,并且我在 Preferences->General->Network Connections 中设置了正确的代理信息

HTTP HTTPS

我知道这是可行的,因为我可以使用帮助->检查更新或帮助->安装新软件。

但是,当我尝试编写一些基本的 python 代码从 Quandl 获取数据时,我不断收到这个奇怪的错误:

QUANDL_API_URL = 'https://www.quandl.com/api/v1/'
url = QUANDL_API_URL + 'datasets/{}.csv?'.format("FRED/GDP")

在这种情况下 url =

https://www.quandl.com/api/v1/datasets/FRED/GDP.csv?

我知道这是正确的,因为您可以在 chrome 中访问该 URL 并下载 csv 文件,然后我在 python 中使用:

import pandas as pd
data = pd.read_csv(url, index_col=1)

我得到以下堆栈跟踪:

URLError: <urlopen error [Errno 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond>

我需要在 Eclipse 中做一些奇怪的事情来让它发挥作用吗?使用像 Canopy 这样的另一个 IDE 进行披露,这工作正常,没有错误。有什么线索吗?

谢谢-

【问题讨论】:

    标签: python eclipse pandas proxy


    【解决方案1】:

    假设您使用的是 Windows,这可能是一个配置问题(环境变量 HTTP_PROXY 可能是一个不错的起点)。

    作为一种解决方法,我会考虑使用类似 urllib2 的东西来获取 CSV 并将其传递到 read_csv 而不是直接传递 URL。

    这个答案似乎适合你: Using an HTTP PROXY - Python

    【讨论】:

      猜你喜欢
      • 2011-10-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-02-12
      • 1970-01-01
      • 1970-01-01
      • 2016-12-07
      • 1970-01-01
      相关资源
      最近更新 更多