make the data directory
try:
os.mkdir('/tmp/anime')
except OSError:
pass
# download the zipped dataset to the data directory
data_url = "https://storage.googleapis.com/laurencemoroney-blog.appspot.com/Resources/anime-faces.zip"
data_file_name = "animefaces.zip"
download_dir = '/tmp/anime/'
urllib.request.urlretrieve(data_url, data_file_name)
# extract the zip file
zip_ref = zipfile.ZipFile(data_file_name, 'r')
zip_ref.extractall(download_dir)
zip_ref.close()
then get an error
HTTPError Traceback (most recent call last)
<ipython-input-3-34b559a04612> in <module>
9 data_file_name = "animefaces.zip"
10 download_dir = '/tmp/anime/'
---> 11 urllib.request.urlretrieve(data_url, data_file_name)
12
13 # extract the zip file
6 frames
/usr/lib/python3.8/urllib/request.py in http_error_default(self, req, fp, code, msg, hdrs)
647 class HTTPDefaultErrorHandler(BaseHandler):
648 def http_error_default(self, req, fp, code, msg, hdrs):
--> 649 raise HTTPError(req.full_url, code, msg, hdrs, fp)
650
651 class HTTPRedirectHandler(BaseHandler):
HTTPError: HTTP Error 404: Not Found
is that URL wrong, or I do some thing wrong?