pieterm Posted April 7, 2020 Posted April 7, 2020 (edited) For my master thesis I need realtime GTFS data which can be retrieved and parsed with python.I have this script working locally.When executed here i get a 500 error. (Exec format error: exec of '***/cgi-bin/gtfsrealtime.py' failed: ***/cgi-bin/gtfsrealtime.py) Could it be that the modules from the google packages I'm importing are missing? (I've read on the forum that the requests package should be installed)Would it be possible to have them installed if so? (I am on Johnny using python 2.7) Thanks in advance! from google.transit import gtfs_realtime_pb2 from google.protobuf import json_format import requests feed = gtfs_realtime_pb2.FeedMessage() response = requests.get('https://***') feed.ParseFromString(response.content) json = json_format.MessageToJson(feed) f = open("test.json", "w") f.write(json) for entity in feed.entity: if entity.HasField('trip_update'): print entity.trip_update f.close() Edited April 7, 2020 by pieterm
Sn1F3rt Posted April 7, 2020 Posted April 7, 2020 Yeah they aren't installed on Johnny's python v2.7 => http://krydos2.heliohost.org/cgi-bin/modules27.py Krydos can install them for you. 1
Krydos Posted April 7, 2020 Posted April 7, 2020 # pip install google.transit Collecting google.transit Could not find a version that satisfies the requirement google.transit (from versions: ) No matching distribution found for google.transit # pip install google.protobuf Collecting google.protobuf Could not find a version that satisfies the requirement google.protobuf (from versions: ) No matching distribution found for google.protobuf
Krydos Posted April 8, 2020 Posted April 8, 2020 There you go https://krydos2.heliohost.org/cgi-bin/modules27.py 1
pieterm Posted April 8, 2020 Author Posted April 8, 2020 There you go https://krydos2.heliohost.org/cgi-bin/modules27.py Thank you for the quick support, the two modules seem to be working! I see in the list that the requests module isn't there. (also my code tells me: AH01215: ImportError: No module named requests:)Could you install this one as well please?
Krydos Posted April 9, 2020 Posted April 9, 2020 There you go https://krydos2.heliohost.org/cgi-bin/modules27.py 1
Recommended Posts