While developing the app, import clipboard or pyperclip doesn't work

Hi

It’s working in local page but while develping the app, import clipboard or pyperclip doesn’t work with the error like this
how to fix?

I’ve solved the import issue.
That’s because it requires requirements.text in the same repository.

But, still struggling pyperclip doesn’t work now in window
It might not be streamlit issue.

If you plan to run your app on streamlit cloud or any other server, pyperclip will not work.

Hi Franky, do you know why pyperclip doesn’t work on Streamlit when the app is run.

When the app is run in a remote server. This is because pyperclip can access only the clipboard of the server, not of another machine like your computer.

Thanks for the response. I assume there is no way to add a ‘copy to clipboard’ function to st.button?

Not a builtin one, as far as I know. I guess you could pass the data from the server to the client using the components API and then use javascript to put the data in the clipboard.

I am assuming you want to copy data from the app to the client’s clipboard. If not, please clarify.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.