I’m having trouble with the requirements needed for my app to run. I have a requirements.txt file in the root of my repo which contains the following. I need to use psycopg2 to connect to my database and followed Streamlits documentation on how to connect to PostgreSQL. I’m not having any issues with either pandas or numpy, but the application continuously returns
ModuleNotFoundError: No module named ‘sqlalchemy’. You need to install the ‘sqlalchemy’ package to use this connection.
Here is what my requirements.txt looks like. I do not know if I need anything more for it. or if with just having the text file in there should work.
streamlit
pandas
numpy
psycopg2-binary
sqlalchemy
To be honest, right now I’m not building the app locally but using Codespaces if that makes any change.
Yes! I have tried specifying the version for both psycopg2 and sqlalchemy but with no luck. I attached a picture below the comment where we can see directly in the Codespace how is the environment complaining about the modules directly from the requirements.txt
The app runs except for the mentioned packages. If I remove any call for them it runs via CodeSpaces, it runs when locally and deployed as an app. It fails whenver I try to call
Thanks for stopping by! We use cookies to help us understand how you interact with our website.
By clicking “Accept all”, you consent to our use of cookies. For more information, please see our privacy policy.
Cookie settings
Strictly necessary cookies
These cookies are necessary for the website to function and cannot be switched off. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms.
Performance cookies
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us understand how visitors move around the site and which pages are most frequently visited.
Functional cookies
These cookies are used to record your choices and settings, maintain your preferences over time and recognize you when you return to our website. These cookies help us to personalize our content for you and remember your preferences.
Targeting cookies
These cookies may be deployed to our site by our advertising partners to build a profile of your interest and provide you with content that is relevant to you, including showing you relevant ads on other websites.