"ModuleNotFoundError: No module named 'auth0.v3'" Error when Running Python Script
Sep 10, 2025
Overview
The following error is being returned when attempting to run a Python script, which leverages the auth0-python library, to export users:
>> python3 export.py
Traceback (most recent call last):
File "/export.py", line 7, in <module>
from tools import Config, get_auth0
File "tools.py", line 4, in <module>
from auth0.v3 import Auth0Error
ModuleNotFoundError: No module named 'auth0.v3'
Applies To
- Python 3
- Auth0-python library
Cause
The following is a snippet of the script to show the setup and imports being used:
export.py
import datetime
import os
import subprocess
import time
import wget
from tools import Config, get_auth0
# Export all users from all connections
# Retrieve the gzipped file
# Decompress it
config = Config()
domain = config.import_domain
non_interactive_client_id = config.import_client_id
non_interactive_client_secret = config.import_client_secret
auth0 = get_auth0(non_interactive_client_id, non_interactive_client_secret, domain)
.........
tools.py
import datetime
import os
from auth0.v3 import Auth0Error
from auth0.v3.authentication import GetToken
from auth0.v3.management import Auth0
from dotenv import load_dotenv
# Tools used by the migration process
# Config
# Reads the .env file and loads the values
# Store the start time
# Get elapsed time
class Config:
time_format = "%Y-%m-%dT%H:%M:%S.%fZ"
def __init__(self):
load_dotenv()
............
Solution
pip install auth0-python==3.24.1