OliverSherouse / wbdata

A python library for accessing world bank data
GNU General Public License v2.0
182 stars 55 forks source link

import wbdata in python script #4

Closed Diana-D closed 7 years ago

Diana-D commented 9 years ago

Hello, I have started to use wbdata with python 2.7.3 on a Debian GNU/Linux 7 machine and everything went fine but after a while I was no longer able to import wbdata module:

import wbdata Traceback (most recent call last): File "", line 1, in File "/usr/local/lib/python2.7/dist-packages/wbdata/init.py", line 23, in from .api import (get_country, get_data, get_dataframe, get_panel, File "/usr/local/lib/python2.7/dist-packages/wbdata/api.py", line 31, in from . import fetcher File "/usr/local/lib/python2.7/dist-packages/wbdata/fetcher.py", line 104, in if not len(CACHE.cache)== 0: File "/usr/local/lib/python2.7/dist-packages/wbdata/fetcher.py", line 82, in cache cache = pickle.load(cachefile) EOFError

I tried reinstalling wbdata but nothing changed. Could anyone suggest a solution? Thank you.

OliverSherouse commented 9 years ago

Hm. Looks like there's a problem with the cache file. I'll try to reproduce, but in the meantime, you might try deleting it and trying again. Since you're on Linux you can delete by running:

rm -r ~/.cache/wbdata

in your shell.

Diana-D commented 9 years ago

Thank you for your reply. My initial workaround was to fetch the data directly from URL instead of checking the cache. The original version of fetcher.py works now after deleting the cache.