Closed paulbradleysmith closed 4 years ago
Is this error below telling me it can't download the geonames database I've asked for?
Yes, as the databases are still in public access http://download.geonames.org/export/zip/ that probably means that you have no direct internet connection on your server.
Likely you would need to configure the proxy used in your network by setting the appropriate environment variables so that requests package (used in pgeocode) is able to use it.
Thank you.
Closing as resolved.
Hi, I was trying to follow your solution @rth but no luck...
I see in a code you have this:
with urllib.request.urlopen(url) as res: with BytesIO(res.read()) as reader: if url.endswith(".zip"): with ZipFile(reader) as fh_zip: with fh_zip.open(country.upper() + ".txt") as fh: yield fh else: yield reader
so, there is no way to pass proxy settings inside of urllib request... Could you please check if some solution exists?
I have pip installed pgeocode with the --user flag as I am on a shared server and lack permissions to write in most places except my home. As a test, I use this demo code:
Is this error below telling me it can't download the geonames database I've asked for?
Thanks.