sqlacodegen getting error

1,275 views
Skip to first unread message

Ajay Raikar

unread,
Nov 13, 2022, 6:02:04 AM11/13/22
to sqlalchemy
Hi Team,

I have installed a fresh project in which i wanted to generate ms-sql db class models with help of sqlacodegen I was not able to do that getting this error as attached in screenshot.  Also I did the pip check it says no broken requirement.
Even I tried down grading SQLAlchemy to 3.1.24 as in sqlacodengen read me it was mentioned it only supported 3.x.x version still no luck!
Please help me to solve this. 
Thanks in Advance...!


Error - 
PS C:\Users\User\OneDrive\Documents\Github\PythonPOC> sqlacodegen --help    
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\User\AppData\Roaming\Python\Python311\Scripts\sqlacodegen.exe\_
                                                                               __main__.py", line 4, in <module>
  File "C:\Users\User\AppData\Roaming\Python\Python311\site-packages\sqlacodegen
                                                                               n\main.py", line 11, in <module>
    from sqlacodegen.codegen import CodeGenerator
  File "C:\Users\User\AppData\Roaming\Python\Python311\site-packages\sqlacodegen
                                                                               n\codegen.py", line 9, in <module>
    from inspect import ArgSpec
ImportError: cannot import name 'ArgSpec' from 'inspect' (C:\Program Files\Pytho
                                                                               on311\Lib\inspect.py)
pip check is success.jpg
Error.jpg

Ajay Raikar

unread,
Nov 13, 2022, 6:07:04 AM11/13/22
to sqlalchemy
Sorry the version i tried is 1.3.24 SQLAlchemy as mentioned in readme of sqlacodegen => 0.8.x - 1.3.x
sqlalchemy version.jpg

Lele Gaifax

unread,
Nov 13, 2022, 7:39:26 AM11/13/22
to sqlal...@googlegroups.com
Ajay Raikar <ajayra...@gmail.com> writes:

>> n\codegen.py", line 9, in <module>
>> from inspect import ArgSpec
>> ImportError: cannot import name 'ArgSpec' from 'inspect' (C:\Program
>> Files\Pythoon311\Lib\inspect.py)
>>

Apparently the ArgSpec has been removed after a long deprecation period
in https://github.com/python/cpython/pull/28618, replaced by FullArgSpec.

Reasonably this should be reported to sqlacodegen team.

ciao, lele.
--
nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri
real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia.
le...@metapensiero.it | -- Fortunato Depero, 1929.

Ajay Raikar

unread,
Nov 13, 2022, 8:03:49 AM11/13/22
to sqlalchemy
Hey  Ciao lele,

Thanks for your reply. I will report this to sqlacodegen team. 
Also, can you suggest any other good ORM that can auto-generate DB classes...?

Thanks & Regards,
Ajay Raikar

Lele Gaifax

unread,
Nov 13, 2022, 9:20:49 AM11/13/22
to sqlal...@googlegroups.com
Ajay Raikar <ajayra...@gmail.com> writes:

> can you suggest any other good ORM that can auto-generate DB
> classes...?

I cannot really say anything on the "goodness" of other ORMs, but I
guess that is a "frequently asked facility".

A quick search reveals for example

https://docs.peewee-orm.com/en/latest/peewee/playhouse.html#pwiz

for Peewee.
Reply all
Reply to author
Forward
0 new messages