Getting a ModuleNotFoundError using YML instead of requirements.txt

Hey y’all,

I’m having an issue deploying a streamlit app. I’ve created a YML to generate an environment for the application. Streamlit Cloud seems to like it, and as best I can tell is creating the environment without an issue.

One of the modules in the dependencies is alpha-vantage (to do an API call for intraday trading data), and I keep getting the following error: ModuleNotFoundError: No module named 'alpha_vantage'.

The application runs fine locally, and the YML creates the environment just fine, too. Just curious if anyone had any thoughts before I go through some extra hassle of setting up a data pipeline.

Here is the YML code:

name: stonks

- python = 3.7
- numpy
- pandas
- plotly
- pathlib
- requests
- nbformat
  - os
  - alpha_vantage=0.1.9

Hi @jaredpj, welcome to the Streamlit community!

Without seeing the code, I suspect you might be running a subprocess to call the API? If so, then this knowledge base article explains how to do it properly so that packages can be found: