Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImportError: cannot import name 'BeanieBaseUser' from 'fastapi_users.db' #978

Closed
galvakojis opened this issue May 6, 2022 · 5 comments
Closed
Labels
bug Something isn't working

Comments

@galvakojis
Copy link

galvakojis commented May 6, 2022

Describe the bug

I am trying to update fastapi-users from version 5 to 10, but it fails at the beginning when I am trying to import BeanieBaseUser
ImportError: cannot import name 'BeanieBaseUser' from 'fastapi_users.db'
my user file looks like this:


from beanie import PydanticObjectId
from fastapi_users.db import BeanieBaseUser, BeanieUserDatabase
from fastapi_users import schemas


class User(BeanieBaseUser[PydanticObjectId]):
    nick_name: str

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

Configuration

  • Python version : 3.8
  • FastAPI version : 0.71.0
  • FastAPI Users version[beanie] : =5.1.0 ->10.0.0
@galvakojis galvakojis added the bug Something isn't working label May 6, 2022
@frankie567
Copy link
Member

There is indeed a circular import issue 😞 I'll fix this right away! Thank you for reporting!

@frankie567
Copy link
Member

It should be fixed with fastapi-users[beanie] >= 10.0.1 (check that fastapi-users-db-beanie == 1.0.1 is installed after that).

@frankie567
Copy link
Member

@galvakojis I received an e-mail notification with a new comment you posted, but I can't see it. Did you delete it?

@galvakojis
Copy link
Author

yes, I did

@MJChimal
Copy link

MJChimal commented May 26, 2022

Hi, @frankie567 I'm using the 10.0.5 fastapi_users version, and I have the same problem. I verified the fastapi_users_db_beanie version and it's 1.0.1.

Captura de Pantalla 2022-05-26 a la(s) 13 31 07

Captura de Pantalla 2022-05-26 a la(s) 13 31 33

Any ideas?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants