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
Thanks for stopping by! We use cookies to help us understand how you interact with our website.
By clicking “Accept all”, you consent to our use of cookies. For more information, please see our privacy policy.
Cookie settings
Strictly necessary cookies
These cookies are necessary for the website to function and cannot be switched off. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms.
Performance cookies
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us understand how visitors move around the site and which pages are most frequently visited.
Functional cookies
These cookies are used to record your choices and settings, maintain your preferences over time and recognize you when you return to our website. These cookies help us to personalize our content for you and remember your preferences.
Targeting cookies
These cookies may be deployed to our site by our advertising partners to build a profile of your interest and provide you with content that is relevant to you, including showing you relevant ads on other websites.