iam-abbas / FastAPI-Production-Boilerplate

A scalable and production ready boilerplate for FastAPI
MIT License
399 stars 58 forks source link

ImportError: cannot import name 'TypeAliasType' from 'typing_extensions' #15

Open realsbd opened 1 month ago

realsbd commented 1 month ago

When i run make migrate, i got this error

$ make migrate poetry run alembic upgrade head Traceback (most recent call last): File "<frozen runpy>", line 198, in _run_module_as_main File "<frozen runpy>", line 88, in _run_code File "C:\Users\DELL\AppData\Local\pypoetry\Cache\virtualenvs\bicxchange-PYV2jhZE-py3.11\Scripts\alembic.exe\__main__.py", line 4, in <module> File "C:\Users\DELL\AppData\Local\pypoetry\Cache\virtualenvs\bicxchange-PYV2jhZE-py3.11\Lib\site-packages\alembic\__init__.py", line 1, in <module> from . import context File "C:\Users\DELL\AppData\Local\pypoetry\Cache\virtualenvs\bicxchange-PYV2jhZE-py3.11\Lib\site-packages\alembic\context.py", line 1, in <module> from .runtime.environment import EnvironmentContext File "C:\Users\DELL\AppData\Local\pypoetry\Cache\virtualenvs\bicxchange-PYV2jhZE-py3.11\Lib\site-packages\alembic\runtime\environment.py", line 19, in <module> from sqlalchemy.sql.schema import Column File "C:\Users\DELL\AppData\Local\pypoetry\Cache\virtualenvs\bicxchange-PYV2jhZE-py3.11\Lib\site-packages\sqlalchemy\__init__.py", line 12, in <module> from . import util as _util File "C:\Users\DELL\AppData\Local\pypoetry\Cache\virtualenvs\bicxchange-PYV2jhZE-py3.11\Lib\site-packages\sqlalchemy\util\__init__.py", line 15, in <module> from ._collections import coerce_generator_arg as coerce_generator_arg File "C:\Users\DELL\AppData\Local\pypoetry\Cache\virtualenvs\bicxchange-PYV2jhZE-py3.11\Lib\site-packages\sqlalchemy\util\_collections.py", line 39, in <module> from .typing import is_non_string_iterable File "C:\Users\DELL\AppData\Local\pypoetry\Cache\virtualenvs\bicxchange-PYV2jhZE-py3.11\Lib\site-packages\sqlalchemy\util\typing.py", line 56, in <module> from typing_extensions import TypeAliasType as TypeAliasType # 3.12 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ImportError: cannot import name 'TypeAliasType' from 'typing_extensions' (C:\Users\DELL\AppData\Local\pypoetry\Cache\virtualenvs\bicxchange-PYV2jhZE-py3.11\Lib\site-packages\typing_extensions.py) make: *** [Makefile:55: migrate] Error 1

daniilmastrangeli commented 1 month ago

@realsbd check ur python version

realsbd commented 1 month ago

@realsbd check ur python version

image my python version in the docker is 3.10

iam-abbas commented 1 month ago

You need python 3.11.1

i recommend using a version manager like this: https://asdf-vm.com/