I’m getting an module not found error when running my app locally. I’m trying to import the nba-api module. I don’t get an error when running a script locally but whenever i try to run ‘streamlit run Home.py’ locally i get a module not found error.
2023-11-11 22:41:52.677 Uncaught app exception
Traceback (most recent call last):
File “/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/streamlit/runtime/scriptrunner/script_runner.py”, line 534, in _run_script
exec(code, module.dict)
File “/Users/parth/coding_projects/sports/Home.py”, line 3, in
from data.nba.api import get_player_list
File “/Users/parth/coding_projects/sports/data/nba/api.py”, line 1, in
from nba_api.stats.static import players
ModuleNotFoundError: No module named ‘nba_api’.
Home.py
import streamlit as st
from data.nba.api import get_player_list
st.title("NBA Player Stats Explorer")
player = st.selectbox("Select Player", get_player_list())