Getting AttributeError: module 'streamlit' has no attribute 'set_page_config'

Hi everyone, so I was following along with the documentation of setting the title and page icon from here: API reference — Streamlit 0.87.0 documentation

It seems that I am getting this error AttributeError: module ‘streamlit’ has no attribute 'set_page_config (a screenshot of the same has been shared below)

Are there any solutions to this?

The implementation of the same in my code is shown below:-

import yfinance as yf
import streamlit as st
import pandas as pd

st.set_page_config(page_title="Stock Price", page_icon="chart_with_upwards_trend", layout="centered", initial_sidebar_state = "auto")

st.write("""
# Simple Stock Price App
Shown are the stock closing price and volume of Google!
""")
# https://towardsdatascience.com/how-to-get-stock-data-using-python-c0de1df17e75
#define the ticker symbol
tickerSymbol = 'GOOGL'
#get data on this ticker
tickerData = yf.Ticker(tickerSymbol)
#get the historical prices for this ticker
tickerDf = tickerData.history(period='1d', start='2010-5-31', end='2020-5-31')
# Open	High	Low	Close	Volume	Dividends	Stock Splits

st.line_chart(tickerDf.Close)
st.line_chart(tickerDf.Volume)

Hello @sayonnnnnn, Welcome to the Streamlit community.

I ran your code as it is using Streamlit v0.86.0 and got no errors:

I’m not sure where the issue might be coming from. I would suggest uninstalling and reinstalling Streamlit.

Cheers.

2 Likes

Thank you for your reply @Outsiders17711. Seems like the error might be coming from my end only.