Docs Menu
Docs Home
/ / /
PyMongo
/

Download and Install

Note

Alternative Installation Methods

The following guide shows you how to install PyMongo by using pip. To install PyMongo from source, see Install from Source in the API Documentation.

1

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

2

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

mkdir pymongo-quickstart

Select the tab corresponding to your operating system and run the following commands to create a quickstart.py application file in the pymongo-quickstart directory:

cd pymongo-quickstart
touch quickstart.py
cd pymongo-quickstart
type nul > quickstart.py
3

Select the tab corresponding to your operating system and run the following commands to create and activate a virtual environment in which to install the driver:

python3 -m venv venv
source venv/bin/activate
python3 -m venv venv
. venv\Scripts\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.

Back

Get Started