scikit-learn/scikit-learn — pull request #3152 by jdowns (2014-05-16 02:20:30+00:00)
Title: adding conditional import to lfw.py for python3 support

I tried to run this command from python 3.4:
`lfw_people = datasets.fetch_lfw_people(min_faces_per_person=70, resize=0.4, data_home='datasets')`

I got the following error:

/usr/local/lib/python3.4/site-packages/sklearn/datasets/lfw.py in check_fetch_lfw(data_home, funneled, download_if_missing)
85 url = BASE_URL + target_filename
86 logger.warn("Downloading LFW metadata: %s", url)
---> 87 urllib.urlretrieve(url, target_filepath)
88 else:
89 raise IOError("%s is missing" % target_filepath)

AttributeError: 'module' object has no attribute 'urlretrieve'

Urllib in Python3 no longer supports urllib.urlretrieve. It is now under urllib.request.