datasets / covid-19

Novel Coronavirus 2019 time series data on cases
https://datahub.io/core/covid-19
1.16k stars 604 forks source link

execute code on local pc #77

Closed zomorrod2020 closed 3 years ago

zomorrod2020 commented 4 years ago

because of data was not updated, i tried to download code and execute "process.py" on my pc. but it raise error of "unable to open database file". all stack trace of error is : "PS > python process.py Traceback (most recent call last):

  File "process.py", line 137, in <module>
    'aggregate': 'first'
  File "C:\Program Files\Anaconda3\lib\site-packages\dataflows\processors\join.py", line 363, in join
    return join_aux(source_name, source_key, source_delete, target_name, target_key, fields, full, mode)
  File "C:\Program Files\Anaconda3\lib\site-packages\dataflows\processors\join.py", line 172, in join_aux
    db_keys_usage = KVFile()
  File "C:\Program Files\Anaconda3\lib\site-packages\kvfile\kvfile.py", line 19, in __init__
    self.db = DB_ENGINE.connect(self.tmpfile.name)
sqlite3.OperationalError: unable to open database file"

can you help me?

nirabpudasaini commented 4 years ago

If you are running Windows this might be the problem with dataflows https://github.com/datahq/dataflows/issues/57

paulmz1 commented 4 years ago

I got it to work on windows by editing kvfile.py and changing self.db = DB_ENGINE.connect(self.tmpfile.name) to self.db = DB_ENGINE.connect(':memory:')

Or another fix is to add os.remove(self.tmpfile.name) above self.db = DB_ENGINE.connect(self.tmpfile.name) This second fix caches to disk as intended but is so slow compared to ':memory:'

You probably shouldn't be editing library files but this could be a useful quick hack for people wanting to develop on their windows PC.

sglavoie commented 3 years ago

INACTIVE: Closing as we have not heard back from the author. If the problem is confirmed to be coming from dataflows, please open an issue at datahq/dataflows.