tortoise / aerich

A database migrations tool for TortoiseORM, ready to production.
https://github.com/tortoise/aerich
Apache License 2.0
820 stars 94 forks source link

ImportError: cannot import name 'Tortoise' from 'tortoise' (unknown location) #184

Open Mng-dev-ai opened 3 years ago

Mng-dev-ai commented 3 years ago

After install aerich when I run aerich -h I got this error : ImportError: cannot import name 'Tortoise' from 'tortoise' (unknown location)

spacemanspiff2007 commented 3 years ago

pip install tortoise-orm

wwweww commented 1 year ago

What version of python are you using? I had this problem when I was using 3.10. I solved it after dropping back to 3.9.

andyfcx commented 1 year ago

using 3.11, failed

wwweww commented 1 year ago

You can try returning your python version to 3.9 and try again because this module is incompatible with older versions of python

andyfcx commented 1 year ago

@wwweww Actually no, it's the problem of another package called tortoise, which is unrelated with this orm, just reinstall all tortoise-orm, everything works good.

rajdeep1mg commented 1 year ago

@wwweww Actually no, it's the problem of another package called tortoise, which is unrelated with this orm, just reinstall all tortoise-orm, everything works good.

how to do that

pawelkoston commented 1 year ago

After accidental install of tortoise instead of tortoise-orm I had to manually remove it from virtual env.

pip3 uinstall tortoise #did not help
cd /path/to/env/lib/python3.11/site-packages/
rm -rf tortoise*
pip3 install tortoise-orm
quvonchbek-dev commented 1 year ago

@pawelkoston Worked, thank you.