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

Getting an "ImportError: cannot import name 'ArgSpec' from 'inspect'" Error #258

Closed
1 task done
GeorgAubele opened this issue Mar 10, 2023 · 5 comments
Closed
1 task done

Comments

@GeorgAubele
Copy link

Things to check first

  • I have searched the existing issues and didn't find my feature already requested there

Feature description

Can't use sqlacodegen, because I'm getting this error everytime I start it, even with

sqlacodegen --help

Error Messages as folllows:
Traceback (most recent call last):
File "", line 198, in _run_module_as_main
File "", line 88, in run_code
File "E:\Programme\Python\Scripts\sqlacodegen.exe_main
.py", line 4, in
File "E:\Programme\Python\Lib\site-packages\sqlacodegen\main.py", line 11, in
from sqlacodegen.codegen import CodeGenerator
File "E:\Programme\Python\Lib\site-packages\sqlacodegen\codegen.py", line 9, in
from inspect import ArgSpec
ImportError: cannot import name 'ArgSpec' from 'inspect' (E:\Programme\Python\Lib\inspect.py)

Use case

I want to use sqlacodegen and don't know how to file a bug report.

@bobzomer
Copy link

ArgSpec has been removed from Python 3.11. You have two solutions:

  1. Downgrade your Python version to 3.10.
  2. Use my forked version of sqlacodegen with simple fix. Just replace sqlacodegen in your requirements.txt by git+https://github.com/bobzomer/sqlacodegen@Maintenance_V2#egg=sqlacodegen.

@agronholm I see that you began a big refactoring towards a 3.0 version. In the meantime, would you be open to create a maintenance branch and release a 2.3.1 based on my fork and branch?

@agronholm
Copy link
Owner

Solution number 3: use the 3.0 release candidate which contains the fix.

@497100512
Copy link

Comment on this code
image
success

@thinkjrs
Copy link

@agronholm Can we close this issue? It seems like an exact dupe of #239, for which there's a clear/simple solution (to which you referred herein, using the release candidate 3.0).

@agronholm
Copy link
Owner

Yup.

@agronholm agronholm closed this as not planned Won't fix, can't repro, duplicate, stale May 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants