Forums

I can't run my script

I'm brand new to pythonanywhere. I tested this script on my local computer and everything is working. I'm trying to run it on pythonanywhere and I'm getting the following error message.

I have a CSV file, a file with functions (this one ran without issue), and finally I have the main python script, this is the one with the error.

What can I do to fix this? I'm new so I probably need thorough instructions.

Traceback (most recent call last): File "/usr/lib/python3.7/site-packages/urllib3/connectionpool.py", line 594, in urlopen self._prepare_proxy(conn) File "/usr/lib/python3.7/site-packages/urllib3/connectionpool.py", line 815, in _prepare_proxy conn.connect() File "/usr/lib/python3.7/site-packages/urllib3/connection.py", line 324, in connect self._tunnel() File "/usr/lib/python3.7/http/client.py", line 911, in _tunnel message.strip())) OSError: Tunnel connection failed: 403 Forbidden During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/lib/python3.7/site-packages/requests/adapters.py", line 445, in send timeout=timeout File "/usr/lib/python3.7/site-packages/urllib3/connectionpool.py", line 638, in urlopen _stacktrace=sys.exc_info()[2]) File "/usr/lib/python3.7/site-packages/urllib3/util/retry.py", line 398, in increment raise MaxRetryError(_pool, url, error or ResponseError(cause)) urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='www.aviationweather.gov', port=443): Max retries exceeded with url: /metar/data?ids=PABA&format=decoded&date=&hours=0 (Caused by ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 403 Forbidden') ))

To be more clear, I have a CSV file with about 1500 airports, so I'm going to www.aviationweather.gov to fetch data for each airports. Then from that data, I'm creating a folium map.

I'm assuming this is because aviationweather.gov is not whitelisted. Is there a way to whitelist aviationweather.gov? This website is available for public use.

https://www.pythonanywhere.com/whitelist/

This is the website I'll be accessing for airports. https://www.aviationweather.gov/metar/data?ids=KMTN&format=decoded&date=&hours=0

That looks like a regular website. They can only whitelist APIs.

As far as I know, aviationweather.gov doesn't have API. Correct me if I'm wrong, but weather.gov is whitelisted, but it also doesn't have an API.

I send a request to whitelist aviationweather.gov, hopefully it will. If it doesn't my script can run here unfortunatelly.

aviationweather.gov is part of NOAA and weather.gov

If yo go to aviationweather.gov you can see there's a link to NOAA and weather.gov on the top left.

Also, I'm using Leaflet and OpenStreetMap to generate the map, so those might need to be white listed also. I would think they're already white listed since they have APIs.

Please click on the image for the picture.

Image

Unfortunately we can only whitelist sites with an official, documented public API :-(

I'm sorry for asking but then how come weather.gov is whitelisted? I couldn't find an API for it? Just asking.

I created another account called metar, but this is still tonynsx

I think aviationweather.gov have this rest API.  Now can you add it?  It says they pull info from aviationweather.gov

https://avwx.rest/  

"Most reports are pulled from aviationweather.gov, the official source for aviation weather for pilots in the US, but support exists for additional sources on a regional basis. Station information is compiled from OurAirports"

Let's keep this discussion on one forum thread.

Since I can't use pythonanywhere for my project, can you delete my account? I have two accounts. I'll look into something else.

  • tonynsx
  • metar

We've sent account deletion confirmation emails to the email addresses associated with those accounts.

If you get a paid account, you have unrestricted access to websites

Something very important that @giles neglected to mention

We'd been having a conversation over email separately, so don't worry -- I did make that clear there :-) But yes, that's an important point to mention here in the forums too, for anyone coming across the thread later on.