amazon-sagemaker-examples icon indicating copy to clipboard operation
amazon-sagemaker-examples copied to clipboard

Outdated Documentation

Open shaharj opened this issue 7 years ago • 3 comments

In one of the earlier steps, the example notebook code suggests to use urllib.request however this library has been deprecated. I encountered a ImportError: No module named request error. One should instead just import urllib and write urllib.urlretrieve.

shaharj avatar Mar 26 '19 23:03 shaharj

Hi @shaharj, Which notebook are you referring to?

Thanks, Neelam

neelamgehlot avatar Jan 15 '20 23:01 neelamgehlot

Hi @shaharj, when you ran into the error, did you check if you had requests installed? By default, it is not a built-in module. You'll have to install it yourself: https://stackoverflow.com/questions/17309288/importerror-no-module-named-requests

Thus, using: import urllib then urllib.request.urlretrieve from urllib.request import urlretrieve import urllib.request then urllib.request.urlretrieve(url, filename) works with Python3 (I am using 3.6, but the docs for 3.8 note the same. See the link below.)

As of Python 3.8.3, urllib.request is not deprecated (yet). It might be in the future: https://docs.python.org/3/library/urllib.request.html#legacy-interface

ngrayluna avatar May 25 '20 22:05 ngrayluna

Closing. Please let us know if there are still issues with the proposed solution

seanpmorgan avatar Jan 06 '21 18:01 seanpmorgan