No module named alembic.__main__; 'alembic' is a package and cannot be directly executed
See original GitHub issueI am trying to run alembic inside a venv inside of WSL-2 Ubuntu. I am using using the following command:
python -m alembic revision --autogenerate -m "create foo"
resulting in
/home/ubuntu/code/my-repo/venv/bin/python: No module named alembic.__main__; 'alembic' is a package and cannot be directly executed
python version: Python 3.7.8 alembic version: 1.4.0
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (5 by maintainers)
Top Results From Across the Web
I ma trying to use alembic with fastapi and postgres sql but it ...
I ma trying to use alembic with fastapi and postgres sql but it gives me error that No module named 'database but it...
Read more >[Fixed] ModuleNotFoundError: No module named 'alembic'
Quick Fix: Python raises the ImportError: No module named 'alembic' when it cannot find the library alembic . The most frequent source of...
Read more >Tutorial — Alembic 1.9.0 documentation
The tutorial below assumes the alembic command line utility is present in the local path and when invoked, will have access to the...
Read more >Execute rasa x with an error - Rasa Community Forum
_revision_map File “c:\users\jean\anaconda3\envs\rasa\lib\site-packages\alembic\util\langhelpers.py”, line 230, in get obj.dict[self.name] ...
Read more >How can I use ExecuteSQLOp? - Google Groups
to sqlalchemy-alembic. Hi,. I have a use-case where I need to execute a function called audit_table after a new table is created in...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
usually you should invoke alembic via the entrypoint script /path/to/venv/bin/alembic. if you want to invoke from the python executable directly you would need to say “python -m alembic.config”.
CaselIT has proposed a fix for this issue in the master branch:
Add
__main__.pyfile to alembic package to support invocation https://gerrit.sqlalchemy.org/c/sqlalchemy/alembic/+/2313