Python 3 and Streamlit (and Pandas and Altair)
COVID Pandemic 🔎 Visual Data Explorer usingDev How To
-
Install direnv and make sure path to python and pip bin folders are present in the
PATH
env var- on MacOS (with Python 3.9 already installed with
brew install python@3.9
):
brew install direnv cd pandemia-covid-streamlit echo export PATH="/usr/local/opt/python@3.9/libexec/bin:$PATH" > .envrc
- on MacOS (with Python 3.9 already installed with
-
Install pipenv, activate the environment and install streamlit:
pip install pipenv pipenv shell pipenv install streamlit
-
Run the app:
streamlit run streamlit_app.py
💡 To install dependencies from Pipfile.lock, run pipenv shell
and then pipenv sync
.
💡 In Visual Studio Code, to use the correct python interpreter, run the >Python: Select Interpreter
VS Code command (Cmd+Shift+P
on MacOS) and select the one in your virtual environment.
To find out which one needs to be selected, run pipenv shell
in the terminal and then which python
.