Explain Python import errors

Paste a Python ModuleNotFoundError, such as "No module named 'requests'", and Vibe explains it in plain English: which Python ran your script, where the package went and how a virtual environment keeps the two together.

import-error.txt

Up to 1,500 characters (about 60 lines). Your code is sent to Unvibe and Anthropic to write the explanation. Don't paste keys or passwords. Common key formats are refused.

Vibe9 lines selected

Press Explain it for the sample, or paste your own code first.

What this Python import error sample shows

the message
ModuleNotFoundError: No module named 'requests' means the Python that ran the script looked for a package called requests and didn't find one. The traceback has one frame, line 1, import requests, so nothing after it ran; the run ended with exit code 1. The name in quotes is the name in the import line, which is what Python searched for.
which Python ran
command -v python3 printed /usr/bin/python3 and sys.prefix printed /usr: the system Python. On this test system it has no pip at all: pip install requests answered pip: command not found with exit code 127, and python3 -m pip install requests answered /usr/bin/python3: No module named pip. Packages for this project need a Python of their own.
a virtual environment
python3 -m venv .venv made one in the project folder, and .venv/bin/python -m pip install with the requirements file put requests 2.34.2 in it. .venv/bin/python weather.py then printed the 3 days, starting Mon 30 Nov: high 14C, cloudy, with exit code 0. Running pip as python -m pip through the same Python that runs the script keeps the package and the script together.
the venv not in use
With the venv in place, python3 weather.py still failed with the same error: plain python3 was still the system one. After . .venv/bin/activate, command -v python3 printed /home/dev/weather/.venv/bin/python3 and the script printed the forecast with exit code 0. A venv only counts for the commands that use its Python.

Good to know

  • Run with Python 3.14.7 and pip 26.2.1 on Linux in a test folder mounted at /home/dev/weather, which is why the paths start with /home/dev/weather. On your computer they show where your own file is. The forecast came from Python's http.server on the same machine.
  • The name in the error is the import name, not always the package name. import yaml failed with No module named 'yaml', pip install yaml failed with No matching distribution found for yaml, and installing PyYAML made the script print Lisbon.

Before you trust it: Installing again doesn't help when the script names another Python. With the venv activated, pip ended with Successfully installed and listed requests-2.34.2, yet ./weather.py still failed with No module named 'requests', because its first line was #!/usr/bin/python3, the system Python. With #!/usr/bin/env python3 as the first line, the same command printed the forecast with exit code 0.

Explain Python import errors beside your editor

Unvibe is a free app for Mac and Windows. In the app there is no pasting: select code in any app and press Control+U (Ctrl+Alt+U on Windows).

Install on Mac

curl -fsSL https://unvibe.site/install.sh | bash

Paste into Terminal. Unvibe isn't notarized by Apple yet, so this is the smooth path.

No install warning? Use Unvibe in your browser

Opening the .dmg the first time

Unvibe isn't notarized by Apple yet, so macOS blocks the first open until you allow it. Its code is public on GitHub.

  1. Open the .dmg, drag Unvibe to Applications and open it. macOS says it can't verify it. Click Done, not the blue Move to Trash.
    macOS dialog: “Unvibe” Not Opened, with a blue Move to Trash button on top and Done under it
    Real screen, macOS 26. On macOS 15 the two buttons sit side by side.
  2. System Settings › Privacy & Security, scroll down to Security, then press Open Anyway. Confirm, then enter your Mac password. The button shows for about an hour after you try to open Unvibe.
    macOS Privacy & Security, Security section: Unvibe was blocked to protect your Mac, with the Open Anyway button
    Real screen, macOS 15
  3. Unvibe opens. You only do this once, and later versions install from inside the app with one click.
    Unvibe's first window: Vibe says Hey! I'm Vibe. I explain the code AI writes for you, right beside your editor, over the title Understand the code AI writes
    Real screen, Unvibe 0.1.51 on macOS 26

The Terminal line checks the download against the published SHA-256 and Unvibe's self-signed signature before it installs anything. More help with the first open