tortoise / tortoise/tortoise-orm

ModuleNotFoundError: No module named 'tortoise'

Open
#1,414 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
5.6k
Forks
516
Avg merge
2d 21h
Merged PRs (30d)
9

Description

Describe the bug
Getting error :from tortoise.contrib.fastapi import HTTPNotFoundError, register_tortoise
ModuleNotFoundError: No module named 'tortoise'

but i already installed it in venv , first i was using python3.11, then I downgrade my Python and use python3.10 but i get the same error both time, after that i also checked may be some problems in my both Python so i comment out all tortoise code and try to run fastapi , its run successfully

Expected behavior
A clear and concise description of what you expected to happen.

Additional context
Add any other context about the problem here.
requirements.py
aiosqlite==0.17.0
anyio==3.7.0
fastapi==0.98.0
idna==3.4
iso8601==1.1.0
pydantic==1.10.9
pypika-tortoise==0.1.6
pytz==2023.3
sniffio==1.3.0
starlette==0.27.0
tortoise-orm==0.19.3
typing_extensions==4.7.0

Os Ubuntu 22.04

error: from tortoise.contrib.fastapi import HTTPNotFoundError, register_tortoise
ModuleNotFoundError: No module named 'tortoise'

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with requirements.py and verify which Python interpreter and virtual environment are used when installing tortoise-orm versus running the failing import. Reproduce the reported from tortoise.contrib.fastapi import on Ubuntu with the listed Python and package versions; done requires a confirmed project-specific cause and a reproducible resolution.

Written by the indexing model from the issue text.

Assessment

Tech stack
fastapi, python
Domain
backend, databases
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
18/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.