Connection Python to Atlas is not working - Target machine refused it

I’ve tried connect the application test using Python mentioned in

https://www.mongodb.com/blog/post/getting-started-with-python-and-mongodb

In my personal computer using home internet connection or 4G the test works. But using my computer or another one in school internet it does not work.

The whitelist IP of Atlas allows any connection, even cause I can connect using 4G connection.

The code is

from pymongo import MongoClient

from pprint import pprint

client = MongoClient(‘mongodb://m001-student:zzz@cluster-geiza.n5ytx.mongodb.net/video?retryWrites=true&w=majority’)

db=client.admin

serverStatusResult=db.command(“serverStatus”)
pprint(serverStatusResult)

And the erros is

Is your connect string correct?
Check the hostname after @
Can you connect by shell?
Can you ping your cluster?