-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Examples returning ERRORs #23
Comments
The sync example works fine for me, so this may be a network issue on your end. The async examples in this repo are written with ipython in mind, where they will work as is. With the regular Python interpreter, as stated by the error message, the async code needs to be inside an async function, like this: import asyncio
from streetlevel import streetview
from aiohttp import ClientSession
async def main():
async with ClientSession() as session:
pano = await streetview.find_panorama_async(46.883958, 12.169002, session)
await streetview.download_panorama_async(pano, f"{pano.id}.jpg", session)
if __name__ == "__main__":
asyncio.run(main()) |
Thank you for your answer. line 13, in |
Can you ping |
Thank you for your answer. D:\Hobby2024\GEO StreetView>ping cbk0.google.com Pinging cbk-legacy.l.google.com [216.58.215.174] with 32 bytes of data: Ping statistics for 216.58.215.174: |
While running example_1.py, to my surprise I found one image: "Km97D1NoYIySkjysrp8HMA.jpg" Encouraged by this, I retried 200 times using the command line: |
Running the 1rst example in README:
"Exception has occurred: ClientConnectorError
Cannot connect to host cbk0.google.com:443 ssl:default [The semaphore timeout period has expired]
OSError: [WinError 121] The semaphore timeout period has expired
The above exception was the direct cause of the following exception:
File "D:\Hobby2024\GEO StreetView\streetlevel_00.py", line 4, in
streetview.download_panorama(pano, f"{pano.id}.jpg")
aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host cbk0.google.com:443 ssl:default [The semaphore timeout period has expired]"
Running the 2nd example:
" File "D:\Hobby2024\GEO StreetView\streetlevel_async_00.py", line 4
async with ClientSession() as session:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: 'async with' outside async function"
Any sugestion?
The text was updated successfully, but these errors were encountered: