I want the user to be able to choose maximum 3 options out of a list through multiselect.
Code:
List = st.multiselect(‘Select 3 companies’, companies3[‘name’],3,key = “0123”, max_selections=3)
Error:
TypeError: multiselect() got an unexpected keyword argument ‘max_selections’
it seems from the above screenshot, that max_selection is not part of the code eventhough in the website they mention it
I used your code, substituting a range for the list of companies and removing the default selection of the number 3 and it ran fine for me. The first 3 you have in the line is being interpreted as the default selection (e.g. an item on your list that is selected), but I would expect that to throw a different error if it wasn’t compatible with your list of companies.
thanks for posting your question! Welcome
Are you sure you’re on the latest streamlit?
If you want to check for that, you can check by running streamlit --version.
If you notice you’re not on the latest streamlit version, you can check out these docs to upgrade your streamlit.
thank you for your feedback, unfortunately the issue persist @willhuang I reinstalled and I have the latest version the issue still persist @mathcatsand I copy pasted your code and still get the below error