[Python] How to properly install and import sqlalchemy in a virtualenv [duplicate]

Discussão em 'Python' iniciado por Stack, Março 29, 2025.

  1. Stack

    Stack Membro Participativo

    I am just starting to learn flask. I have installed sqlalchemy into my virtualenv but when I try to import it it gives the following error: No module named 'sqlalchemy'. Below is my code:

    from flask import Flask, redirect, url_for, render_template, request, session, flash
    from datetime import timedelta
    import sqlalchemy


    I have uninstalled it and reinstalled multiple times, I even deleted and did a clean install of python. This is very frustrating because as I am still a fairly new dev I struggle with figuring it out on my own. Any help on figuring this out would be greatly appreciated.

    Edit: This is my list of installed packages: blinker 1.6.2 click 8.1.6 colorama 0.4.6 Flask 2.3.2 Flask-SQLAlchemy 3.0.5 greenlet 2.0.2 itsdangerous 2.1.2 Jinja2 3.1.2 MarkupSafe 2.1.3 pip 23.1.2 setuptools 65.5.0 SQLAlchemy 2.0.19 typing_extensions 4.7.1 Werkzeug 2.3.6

    Continue reading...

Compartilhe esta Página