The problem is that you are following the tutorial from the current release documentation but actually have PyMongo 2.8 installed.
The insert_one()
method is new in PyMongo 3.0 now backported in PyMongo 2.9. So clearly you will need to install PyMongo 2.9 or newer version in order to use the new API feature.
You can install or upgrade your driver using pip
like.
python -m pip install -U pymongo