Skip to content

Commit 21ce93e

Browse files
Cory Lorenzapaszke
authored andcommitted
Fix ImportError with requests in model_zoo (#5896)
Not sure if this is a backwards compatibility issue. ``` Python 2.7.9 (default, Apr 2 2015, 15:35:35) [GCC 4.9.2] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import requests.get as urlopen Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: No module named get >>> from requests import get as urlopen >>> ```
1 parent 2a4b33b commit 21ce93e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

torch/utils/model_zoo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
try:
1111
from requests.utils import urlparse
12-
import requests.get as urlopen
12+
from requests import get as urlopen
1313
requests_available = True
1414
except ImportError:
1515
requests_available = False

0 commit comments

Comments
 (0)