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 'ArgSpec' from 'inspect' #326

Closed
2 tasks done
Abhiz2411 opened this issue May 23, 2024 · 7 comments
Closed
2 tasks done

ImportError: cannot import name 'ArgSpec' from 'inspect' #326

Abhiz2411 opened this issue May 23, 2024 · 7 comments
Labels

Comments

@Abhiz2411
Copy link

Things to check first

  • I have searched the existing issues and didn't find my bug already reported there

  • I have checked that my bug is still present in the latest release

Sqlacodegen version

2.3.0.post1

SQLAlchemy version

1.4.52

RDBMS vendor

PostgreSQL

What happened?

When I ran the command sqlacodegen postgresql://postgres:secret_pass@localhost:5432/db_name > model.py It should have created code in model.py. I researched about the error and I think it is caused because codegen.py has an import statement from inspect import ArgSpec where ArgSpec is depreciated for python 3.12.2. I am using 3.12.2 version of python

Database schema for reproducing the bug

No response

@Abhiz2411 Abhiz2411 added the bug label May 23, 2024
@trembel
Copy link

trembel commented May 29, 2024

For me it is solved using the rc version. Try pip install sqlacodegen==3.0.0rc5, see here: #251

@rafalkrupinski
Copy link

The last stable release is from 2020 and declares requirement on python 3.8
The latest python it actually works is 3.10
I use pipx and pyenv, so no problem. uv should handle it too.

@Abhiz2411
Copy link
Author

Abhiz2411 commented Jan 9, 2025 via email

@agronholm agronholm pinned this issue Jan 23, 2025
@sheinbergon
Copy link
Collaborator

@Abhiz2411 as mentioned earlier, latest 3.0.0rc5 does support python 3.12.
We are currently actively working on a stable 3.0.x release

@agronholm
Copy link
Owner

The reason I pinned this issue is because people who don't know about pre-releases keep re-reporting this.

@agronholm
Copy link
Owner

But admittedly closing it doesn't unpin it, so let's hope people coming in to report this can still find it.

@kdipippo
Copy link

Confirming I was able to find this issue when I encountered this error just now after it's been closed 13 hours ago. 3.0.0rc5 worked perfectly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants