Streamlit is an open source Python library. This utility is designed to create custom web applications for machine learning and data analysis. It is one of the fastest ways to design, build, and deploy data processing applications.
Installing and Configuring Prerequisites
An important component in installing Streamlit is the availability and latest updates to Python. You need to install the required dependencies to compile the Python source code. You can do it like this:
apt-get install wget build-essential libreadline-gplv2-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev libffi-dev zlib1g-dev liblzma-dev -y
The current version for this moment is Python 3.9.6. Using wget, install this:
wget https://www.python.org/ftp/python/3.9.6/Python-3.9.6.tgz
Next – unarchive
tar xzf Python-3.9.6.tgz
Then compiling the code with cd
cd Python-3.9.6 && ./configure --enable-optimizations
Then the Python installation itself. Once again, we draw your attention to the relevance of Python 3.9.6
make altinstall
Set Python 3.9.6 as the default version using the command below:
update-alternatives --install /usr/bin/python python /usr/local/bin/python3.9 1
Update your pip. Location -> /usr/local/bin/python3.9
/usr/local/bin/python3.9 -m pip install --upgrade pip
Then, after checking your Python version (# python –version && pip –version), you can go to your cd root directory
Installing Streamlit
Install your Streamlit using pip. The pip update has already been configured before, and now everything is ready for installation:
pip install streamlit
After successfully installing Streamlit, you need to run it on your operating system. In this article, we are talking about Debian. It is possible to run Streamlit through your HTTPS. To deploy a web application to an HTTP port, first allow the http port on the firewall. As a reminder, http – port is 80, by default:
ufw allow 80
Then start your Streamlit using the following command:
streamlit run main.py --server.port 80
Leave A Comment?