You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
I was following Earth lab's Intro to earth data science textbook and in Section 2, chapter-5 while running the codes for vector files, I am getting BadZipFile errors. This problem seems to be with all files from the Natural Earth webpage. I am able to download the zip file separately but using get_data function is giving an error.
Here is the code I am running:
# Import packages
import os
os.environ['USE_PYGEOS'] = '0'
import matplotlib.pyplot as plt
import geopandas as gpd
import earthpy as et
link = 'https://www.naturalearthdata.com/http//www.naturalearthdata.com/download/50m/cultural/ne_50m_admin_0_boundary_lines_land.zip'
# Download the data and set working directory
et.data.get_data(url=link)
# Set working directory - earthpy creates earth-analytics for you in your home dir
os.chdir(os.path.join(et.io.HOME, 'earth-analytics'))
File ~/miniconda3/envs/earth-analytics-python/lib/python3.8/zipfile.py:1269, in ZipFile.init(self, file, mode, compression, allowZip64, compresslevel, strict_timestamps)
1267 try:
1268 if mode == 'r':
-> 1269 self._RealGetContents()
1270 elif mode in ('w', 'x'):
1271 # set the modified flag so central directory gets written
1272 # even if no files are added to the archive
1273 self._didModify = True
File ~/miniconda3/envs/earth-analytics-python/lib/python3.8/zipfile.py:1336, in ZipFile._RealGetContents(self)
1334 raise BadZipFile("File is not a zip file")
1335 if not endrec:
-> 1336 raise BadZipFile("File is not a zip file")
1337 if self.debug > 1:
1338 print(endrec)
BadZipFile: File is not a zip file
Hope this will be helpful for you in solving the issue.
Thank you
Girish
The text was updated successfully, but these errors were encountered:
It looks like naturalearthdata changed their download so that we can't use the same url anymore when downloading in Python (as opposed to the browser which still works fine). We're working on getting in touch with them so that we can get direct download lines. In the meantime, you can download from naturalearthdata in the browser and move the data into your earthpy-downloads folder under the path the code is looking for.
We'll update here when we have a permanent solution!
Hi,
I was following Earth lab's Intro to earth data science textbook and in Section 2, chapter-5 while running the codes for vector files, I am getting
BadZipFile
errors. This problem seems to be with all files from the Natural Earth webpage. I am able to download the zip file separately but usingget_data
function is giving an error.Here is the code I am running:
I am getting following error:
Hope this will be helpful for you in solving the issue.
Thank you
Girish
The text was updated successfully, but these errors were encountered: