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

ModuleNotFoundError: No module named 'sqlalchemy' - db_updater.py -v #1061

Open
LMS235 opened this issue Feb 26, 2024 · 2 comments
Open

ModuleNotFoundError: No module named 'sqlalchemy' - db_updater.py -v #1061

LMS235 opened this issue Feb 26, 2024 · 2 comments

Comments

@LMS235
Copy link

LMS235 commented Feb 26, 2024

Hello,

db_updater.py -v throw the following error:

  File "/usr/local/bin/alembic", line 5, in <module>
    from alembic.config import main
  File "/usr/local/lib/python3.10/dist-packages/alembic/__init__.py", line 1, in <module>
    from . import context
  File "/usr/local/lib/python3.10/dist-packages/alembic/context.py", line 1, in <module>
    from .runtime.environment import EnvironmentContext
  File "/usr/local/lib/python3.10/dist-packages/alembic/runtime/environment.py", line 19, in <module>
    from sqlalchemy.sql.schema import Column
ModuleNotFoundError: No module named 'sqlalchemy'

but the problem is that sqlalchemy cannot work with MongoDB

https://docs.sqlalchemy.org/en/13/dialects/
or https://stackoverflow.com/questions/51159461/flask-error-sqlalchemy-exc-nosuchmoduleerror-cant-load-plugin-sqlalchemy-dia

so if you install sqlalchemy you get another error "sqlalchemy.dialects:mongodb".

Could someone take a look at this?

@P-T-I
Copy link
Member

P-T-I commented Apr 10, 2024

@LMS235 Could you verify if this issue still exists? I believe it to be fixed (upstream)

@oh2fih
Copy link
Contributor

oh2fih commented Apr 10, 2024

This doesn't seem like a SQL vs. MongoDB issue as suggested. The ModuleNotFoundError suggests that sqlalchemy wasn't installed on the machine. Both python3-sqlalchemy package or installing the dependencies with pip3 install -r requirements.txt should solve this.

What might be an issue in CveXplore is if these modules are loaded even if SQL is not configured. The imports can be conditional, too.

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

No branches or pull requests

3 participants