From 0eddce75e4457150bd4a2a8cd301fc17ca12ea7e Mon Sep 17 00:00:00 2001 From: gitjags Date: Sat, 21 Apr 2018 14:33:32 -0700 Subject: [PATCH] Python 3.5.1 needs urllib.request module for urlretrieve. The python vesion is forced via conda in the environment.yaml --- hipsternet/input_data.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hipsternet/input_data.py b/hipsternet/input_data.py index 43a6b9a..8ce1358 100644 --- a/hipsternet/input_data.py +++ b/hipsternet/input_data.py @@ -1,7 +1,7 @@ """Functions for downloading and reading MNIST data.""" import gzip import os -import urllib +import urllib.request import numpy SOURCE_URL = 'http://yann.lecun.com/exdb/mnist/' @@ -12,7 +12,7 @@ def maybe_download(filename, work_directory): os.mkdir(work_directory) filepath = os.path.join(work_directory, filename) if not os.path.exists(filepath): - filepath, _ = urllib.urlretrieve(SOURCE_URL + filename, filepath) + filepath, _ = urllib.request.urlretrieve(SOURCE_URL + filename, filepath) statinfo = os.stat(filepath) print('Succesfully downloaded', filename, statinfo.st_size, 'bytes.') return filepath