awtkns / fastapi-crudrouter

A dynamic FastAPI router that automatically creates CRUD routes for your models
https://fastapi-crudrouter.awtkns.com
MIT License
1.4k stars 155 forks source link

ModuleNotFoundError: No module named 'fastapi_crudrouter' #92

Closed arkryonia closed 3 years ago

arkryonia commented 3 years ago

Hello.

I'm trying fastapi-crudrouter. Unfortunetly, I'm experiencing an unrecognized issue:

ModuleNotFoundError: No module named 'fastapi_crudrouter'

I have virtualenv with fastapi-crudrouter installed

rom pydantic import  BaseModel
from fastapi import FastAPI
from fastapi_crudrouter import MemoryCRUDRouter as CRUDRouter

class Potato(BaseModel):
    id: int
    color: str
    mass: float

app = FastAPI()

app.include_router(CRUDRouter(schema=Potato))

requiremnts.txt

fastapi==0.68.1
fastapi-crudrouter==0.8.1
pydantic==1.8.2
starlette==0.14.2
typing-extensions==3.10.0.2
rgreen32 commented 3 years ago

@arkryonia Are you running it with your virtualenv activated? Does fastapi-crudrouter show up when you type pip freeze ?

arkryonia commented 3 years ago

Yes my virtualenv is activated.

awtkns commented 3 years ago

@archydeberker what version of python / os are you running? (edit: @arkryonia)

archydeberker commented 3 years ago

@archydeberker what version of python / os are you running?

Bad tag I think @awtkns

awtkns commented 3 years ago

Bad tag I think @awtkns

Sorry about that! Very similar names.

arkryonia commented 3 years ago

@archydeberker what version of python / os are you running? (edit: @arkryonia)

python 3.9
Debian Bulleyse
awtkns commented 3 years ago
FROM debian:bullseye

RUN apt-get update && apt-get install python3 python3-pip -y
COPY requirements.txt requirements.txt

RUN pip install -r requirements.txt
COPY main.py main.py

CMD [ "python3", "./main.py" ]

The docker file above works to install and run the code / environment you gave on debian:bullseye.

arkryonia commented 3 years ago

Ok. I got you. Let me try.