Can't deploy due to missing module - Using 3.8(OSX) but Streamlit sharing keeps forcing 3.7

I’m most likely missing something basic, but I’ve searched the forums for ~20 minutes now and couldn’t find anything similar, so hopefully this will help someone else. Here’s my issue:

I’m deploying a basic Streamlit app to Sharing that works perfectly on localhost. However, when I go to deploy it on I get the following error:

[manager] Cloning repository ...

[manager] Cloning into 'icarus'...

[manager] Cloned repository!

[manager] Processing dependencies ...

[manager] Processed dependencies!

2021-04-01 13:04:51.069 An update to the [server] config option section was detected. To have these changes be reflected, please restart streamlit.

2021-04-01 13:04:51.168 Uncaught app exception

Traceback (most recent call last):

  File "/home/appuser/venv/lib/python3.7/site-packages/streamlit/script_runner.py", line 333, in _run_script

    exec(code, module.__dict__)

  File "/app/icarus/Screener/screener.py", line 2, in <module>

    import yfinance as yf

ModuleNotFoundError: No module named 'yfinance'

[client] Spinning up manager process...

[client] Connecting...

I’m using python 3.8 on OSX locally and my requirements.txt follows the guidelines mentioned in the docs

streamlit>=0.78.0
alpha_vantage
yfinance
pandas
plotly
matplotlib

Is there anyway I can force Sharing to try 3.8 (from the looks of things, it’s supported IIUC)

1 Like

I don’t think the Python version is the problem. As far as I can see, the yfinance package is not dependent on a specific python version!?
I rather suspect that something already goes wrong with the deployment of the dependencies and yfinance is not installed at all!?

Works fine for me on sharing. Is your requirements.txt spelled correctly, and at the top-level of the repo?

Best,
Randy

Thanks Randy! That was it. Needed to be in my top repo, if screener is going to be run from a sub-directory.