0

I am trying to download one dataset from UCI ML repository in Python. Here is my code:

import requests

zip_url = 'http://archive.ics.uci.edu/ml/machine-learning-databases/00228/smsspamcollection.zip'
r = requests.get(zip_url)

But, after running the code I get the following error. What is the reason and how to resolve it?

ConnectionError: HTTPConnectionPool(host='archive.ics.uci.edu', port=80): Max retries exceeded with url: /ml/machine-learning-databases/00228/smsspamcollection.zip (Caused by NewConnectionError('<requests.packages.urllib3.connection.HTTPConnection object at 0x11a3c15c0>: Failed to establish a new connection: [Errno 53] Software caused connection abort',))

martineau
  • 119,623
  • 25
  • 170
  • 301
Hossein
  • 2,041
  • 1
  • 16
  • 29

1 Answers1

0

I would suggest looking into this similar discussion here and this issue. Also i would try to get a connection to other urls using requests.get and see if that works. Also you could try to download the file using cmd-line tools like wget or a webbrowser from the same machine to see if you can get a connection to the server.

Leon
  • 51
  • 5
  • Thanks. The looping idea presented in the link did not work for me. I tested another url from a different host but got the same problem. Downloading from web-browser was OK. – Hossein Jun 04 '17 at 14:40
  • Does your web browser have a proxy configured? – Leon Jun 04 '17 at 14:44
  • Oh! I got what was wrong with my program. There was an application running in the background refusing other application to access the internet! Thanks for your help. – Hossein Jun 04 '17 at 14:52