'python can't find sqlalchemy

So I'm trying to run a python application that I did not make but I need to make it run and I don't want to edit the huge spaghetti code in here. It was made several years ago and is now completely outdated : I know I need an old version of sqlalchemy and other modulesbut I have no idea what version (no documentation). And this is not on my computer to make things even harder. The linux Ubuntu version of this computer was just updated and for some reason, python (2 or 3, same result) can't find the module :

(sqlalchemy-workspace) clubbd@clubbd-To-be-filled-by-O-E-M:~/Documents/Old_DB/sqlalchemy-workspace$ pip list
Package    Version
---------- -------
greenlet   1.1.2
pip        22.0.2
setuptools 59.6.0
SQLAlchemy 1.4.36
wheel      0.37.1
(sqlalchemy-workspace) clubbd@clubbd-To-be-filled-by-O-E-M:~/Documents/Old_DB/sqlalchemy-workspace$ python3 apps.py 
Traceback (most recent call last):
  File "/home/clubbd/Documents/Old_DB/sqlalchemy-workspace/apps.py", line 8, in <module>
    from clubBD import database, model, filter
  File "/home/clubbd/Documents/Old_DB/sqlalchemy-workspace/clubBD/database.py", line 1, in <module>
    from SQLAlchemy import MetaData,create_engine,Table,or_,and_,null
ModuleNotFoundError: No module named 'SQLAlchemy'

I used a virtualenv here to replicate something I found online. I never used it before.

The main answer I see online about this is "use flask_sqlalchemy" but then, I have even less clue about which version use and I'd have to change the imports which are :

from SQLAlchemy import MetaData,create_engine,Table,or_,and_,null
from SQLAlchemy.orm import mapper,relation,create_session,backref

Anyone knows how I could fix this mess? Thanks in advance. Note : I made a new database to replace this thing and it works, but I have to transfer all the data and the old database is really weird with NULL values everywhere, so I can't quite transfer it automatically (I'm working on it tho).



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source