我正在开发一个项目,该项目利用 python 的 wbdata 包,它是世界银行 api 的包装器。它工作得很好,直到我提出了我猜想的大量数据请求,我不得不取消它,现在当我使用 import wbdata 函数时,甚至不会加载包。这就是我得到的
Python 2.7.7 |Anaconda 2.0.1 (64-bit)| (default, Jun 11 2014, 10:40:02) [MSC
v.1500 64 bit (AMD64)]
Type "copyright", "credits" or "license" for more information.
IPython 2.1.0 -- An enhanced Interactive Python.
Anaconda is brought to you by Continuum Analytics.
Please check out: http://continuum.io/thanks and https://binstar.org
? -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help -> Python's own help system.
object? -> Details about 'object', use 'object??' for extra details.
%guiref -> A brief reference about the graphical user interface.
In [1]: import wbdata as wb
Traceback (most recent call last):
File "<ipython-input-1-ae1872a5f07c>", line 1, in <module>
import wbdata as wb
File "C:\Users\Josh New\Anaconda\lib\site-packages\wbdata\__init__.py", line 23, in <module>
from .api import (get_country, get_data, get_dataframe, get_panel,
File "C:\Users\Josh New\Anaconda\lib\site-packages\wbdata\api.py", line 31, in <module>
from . import fetcher
File "C:\Users\Josh New\Anaconda\lib\site-packages\wbdata\fetcher.py", line 104, in <module>
if not len(CACHE.cache)== 0:
File "C:\Users\Josh New\Anaconda\lib\site-packages\wbdata\fetcher.py", line 82, in cache
cache = pickle.load(cachefile)
EOFError
In [2]:
有人可以帮我让这个包再次工作吗?
谢谢
乔什
编辑-运行 %debug cachefile.name 后,我得到以下信息;
%debug cachefile.name
NOTE: Enter 'c' at the ipdb> prompt to continue execution.
> c:\users\josh new\anaconda\lib\encodings\cp1252.py(15)decode()
14 def decode(self,input,errors='strict'):
---> 15 return codecs.charmap_decode(input,errors,decoding_table)
16
ipdb> c
Traceback (most recent call last):
File "C:\Users\Josh New\Anaconda\lib\site-packages\IPython\core\magics\execution.py", line 817, in _run_with_debugger
deb.run(code, code_ns)
File "C:\Users\Josh New\Anaconda\lib\bdb.py", line 400, in run
exec cmd in globals, locals
File "<string>", line 1, in <module>
NameError: name 'cachefile' is not defined