aerich icon indicating copy to clipboard operation
aerich copied to clipboard

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

Open Mng-dev-ai opened this issue 4 years ago • 8 comments

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

Mng-dev-ai avatar Aug 07 '21 02:08 Mng-dev-ai

pip install tortoise-orm

spacemanspiff2007 avatar Aug 10 '21 11:08 spacemanspiff2007

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.

wwweww avatar Feb 09 '23 22:02 wwweww

using 3.11, failed

andyfcx avatar Feb 10 '23 04:02 andyfcx

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

wwweww avatar Feb 10 '23 09:02 wwweww

@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.

andyfcx avatar Feb 10 '23 09:02 andyfcx

@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

rajdeep1mg avatar Feb 10 '23 20:02 rajdeep1mg

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

pawelkoston avatar May 12 '23 13:05 pawelkoston

@pawelkoston Worked, thank you.

quvonchbek-dev avatar Jul 14 '23 20:07 quvonchbek-dev