我正在使用wbdata包的python项目,这是一个世界银行api的包装器。它一直工作正常,直到我做了我所猜测的大量数据请求,我不得不取消数据请求,现在当我使用导入wbdata函数时,程序包甚至无法加载。这里是我得到的EOF导入python包时出错
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]:
有人可以请帮我拿出这个包再次工作?
感谢
乔希
编辑 - 好吧运行调试%我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
%调试 > C:\用户\约什新\安纳康达\ lib中\站点包\ wbdata \ fetcher.py(84)的高速缓存() 83除了IO错误: ---> 84缓存= {} 85 self .__ cache = cache – Josh 2015-04-02 17:26:31
呵呵,'cachefile'是一个文件对象,你需要找到文件名,因此'cachefile.name'如果是用'open()/ file()'创建的,否则你需要阅读源代码。 – 2015-04-02 17:27:27
我假设你是指删除核弹吗? – Josh 2015-04-02 17:29:21