usnistgov / jarvis

JARVIS-Tools: an open-source software package for data-driven atomistic materials design. Publications: https://scholar.google.com/citations?user=3w6ej94AAAAJ https://www.youtube.com/watch?v=2-XHeC8gbeY
https://pages.nist.gov/jarvis/
Other
313 stars 124 forks source link

BadZipFile: File is not a zip file #291

Closed LiangzhengChou closed 1 year ago

LiangzhengChou commented 1 year ago

Describe the bug Hello, an error message of BadZipFile: File is not a zip file appeared when using Jarvis-tools to obtain database data. The program was running normally before today.

To Reproduce Steps to reproduce the behavior:

  1. conda create --name my_jarvis python=3.8
  2. conda activate my_jarvis 3.conda install -c conda-forge jarvis-tools
  3. from jarvis.db.figshare import data d2 = data('dft_2d') 4.see error Obtaining 2D dataset 1.1k ... Reference:https://www.nature.com/articles/s41524-020-00440-1 Other versions:https://doi.org/10.6084/m9.figshare.6815705 162iB [00:00, 163kiB/s] Loading the zipfile... Traceback (most recent call last): File "", line 1, in File "D:\anaconda3\envs\my_jarvis\lib\site-packages\jarvis\db\figshare.py", line 502, in data dat = get_request_data(js_tag=js_tag, url=url, store_dir=store_dir) File "D:\anaconda3\envs\my_jarvis\lib\site-packages\jarvis\db\figshare.py", line 455, in get_request_data data = json.loads(zipfile.ZipFile(path).read(js_tag)) File "D:\anaconda3\envs\my_jarvis\lib\zipfile.py", line 1269, in init self._RealGetContents() File "D:\anaconda3\envs\my_jarvis\lib\zipfile.py", line 1336, in _RealGetContents raise BadZipFile("File is not a zip file") zipfile.BadZipFile: File is not a zip file

Expected behavior

Screenshots p1 p2

Desktop (please complete the following information):

knc6 commented 1 year ago

It seems you were downloading the file and it got interrupted which could have resulted in a corrupted zipfile. I recommend deleting the zip file (d2-12-12-2022.json.zip or similar) in your jarvis/db directory: D:\anaconda3\envs\my_jarvis\lib\site-packages\jarvis\db\ and run the code again.

LiangzhengChou commented 1 year ago

Thank you very much. The problem has been resolved because some regions cannot access the website where the data is stored, resulting in the requests. get() function returning 403