0

I am attemping to use Matplotlib and arcgisimage to download and plot an image using the arcgis REST API service. A snippet error I'm running into is below. I suspect I can't connect to this arcgis server, because I'm being blocked by the firewall at my organization. Typically when I want to download something, say using pip, I have to enter a proxy, i.e. proxy.**.gov:8080. How would I go about getting around this firewall? I've tested my code at home without a firewall, and the arcgisimage works fine, which is why I suspect it's a firewall issue. Thanks.

/opt/antelope/python2.7.8/lib/python2.7/urllib2.pyc in do_open(self, http_class, req)
   1182         except socket.error, err: # XXX what error?
   1183             h.close()
-> 1184             raise URLError(err)
   1185         else:
   1186             try:

URLError: <urlopen error [Errno 110] Connection timed out>
geeb.24
  • 527
  • 2
  • 7
  • 25
  • check the url is open. python tried to connect the URL but failed to connect – ExtractTable.com Mar 06 '18 at 13:26
  • Thanks for your comment. How would I go about checking if the url is open? – geeb.24 Mar 06 '18 at 13:29
  • 1. You can ask your networking team to whitelist the website, if you have to hit the url very often. 2. check this https://stackoverflow.com/questions/3168171/how-can-i-open-a-website-with-urllib-via-proxy-in-python – ExtractTable.com Mar 06 '18 at 13:41
  • Thank you for your help. The question is solved and edited in the original. – geeb.24 Mar 06 '18 at 13:45
  • 1
    Rather than edit the question to add the solution, post it as answer! [Answering your own question is not forbidden](https://meta.stackoverflow.com/a/250208/4733879), but [officially encouraged](https://stackoverflow.com/help/self-answer). (there is even an option to answer the question directly at the [Ask a Question](https://stackoverflow.com/questions/ask) page) – Filnor Mar 06 '18 at 13:47

1 Answers1

1

I did the following, and this should work:

$ export http_proxy='http://myproxy.example.com:1234'
$ python myscript.py  # Using http://myproxy.example.com:1234 as a proxy
geeb.24
  • 527
  • 2
  • 7
  • 25