Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

AttributeError: 'module' object has no attribute 'urlretrieve' in window subsystem ubuntu bash for tensorflow

561 views
Skip to first unread message

Ho Yeung Lee

unread,
May 21, 2017, 2:39:39 AM5/21/17
to
i use window subsystem ubuntu
and install python 3 and tensorflow

then when try deep learning

https://www.tensorflow.org/tutorials/wide_and_deep

got error when urlretrieve local directory in ubuntu in window

tried urllib3 still have error

import tempfile
import pandas as pd
import urllib as urllib
import os

model_dir = tempfile.mkdtemp()
m = tf.contrib.learn.DNNLinearCombinedClassifier(
model_dir=model_dir,
linear_feature_columns=wide_columns,
dnn_feature_columns=deep_columns,
dnn_hidden_units=[100, 50])

...

urllib.urlretrieve(r"/mnt/c/Users/hello/Documents/data.csv", train_file.name)
urllib.urlretrieve(r"/mnt/c/Users/hello/Documents/dataTest.csv", test_file.name)


Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'urlretrieve'

Kev Dwyer

unread,
May 21, 2017, 2:52:35 AM5/21/17
to
If you're using python3, you need to do:

from urllib.request import urlretrieve

0 new messages