I can't connect to mongoDB atlas with python with pycharm

hi there, I’m learning mongoDB.
when I connected mongoDB atlas with python, got error code in python terminer in pycharm.

  1. error code is like this:

<ServerDescription (‘cluster0-shard-00-02.3ar0e.mongodb.net’, 27017) server_type: Unknown, rtt: None, error=AutoReconnect(‘cluster0-shard-00-02.3ar0e.mongodb.net:27017: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1108)’)>]>

  1. till now my condition,

1-install dnspython, pymongo
2- sign up mongodb and try to connect my python to my Cluster0 using MongoDB’s native drivers.
3- I use MacOS Big Sur 11.1 ver.

my knowledge of IT is almost no base… please help me… omg…

Hi @Bright_Knowledge,

Based on the CERTIFICATE_VERIFY_FAILED message, I suspect you need to update your Python environment’s trusted TLS certifications by installing the certifi package:

pip install certifi

If you are still having issues connecting to Atlas after installing certifi, please provide:

  • version of Python reported by: python --version

  • version of PyMongo reported by: pip freeze | grep pymongo

  • current error message received

Regards,
Stennie