Python ModuleNotFoundError: meaning and fix

ModuleNotFoundError: Python could not find the module you tried to import.

Code that causes it

import requests
Open in the runner

This runner has the standard library only. Packages you install separately do not work. The module name is misspelled.

Check that the name is in the standard library. Use packages that need installing in Python on your own computer.

How to fix it

import random
print(random.randint(1, 1))
Open in the runner

Why it happens

import finds a module and loads it. The runner on this page has only the modules that ship with Python.

The official docs are in English. See it in the official Python docs

Back to the runnerMore errors