Docs Menu

Docs HomeDevelop ApplicationsPython DriversPyMongo

Download and Install

1

Ensure you have the following dependencies installed in your development environment:

  • Python3 version 3.7 or later

  • pip

  • dnspython

2

In your shell, run the following command to create a directory called pymongo-quickstart for this project:

mkdir pymongo-quickstart

Run the following command to navigate into the project directory:

cd pymongo-quickstart

Run the following command to create a file to contain your application:

touch quickstart.py
3

Run the following commands in your shell to create and activate a virtual environment in which to install the driver:

python3 -m venv venv
source venv/bin/activate

With the virtual environment activated, run the following command to install the current version of PyMongo:

python3 -m pip install pymongo

After you complete these steps, you have a new project directory and the driver dependencies installed.

Note

If you run into issues on this step, ask for help in the MongoDB Community Forums or submit feedback by using the Rate this page tab on the right or bottom right side of this page.

Next: Create a MongoDB Deployment
← Get Started with PyMongo