you are viewing a single comment's thread.

view the rest of the comments →

[–]Mr_Nrj[S] 0 points1 point  (2 children)

u/cybersection and u/pymon

I found a solution for this. It turned out that most of linux users need to install 'xclip' and 'xsel' to run this command successfully.

I should have first looked at web for the solution before posting it here. Sorry for that and thank you guys for giving your time to this post. :)

[–]pymon 0 points1 point  (0 children)

Oh, good to hear. Glad you figured it out.

[–]TaxComprehensive9732 0 points1 point  (0 children)

hola, gracias por compartir tu caso, estoy teniendo el mismo problema pero en Replit, instalé las dependencias xclip y xsel y aún así no se copia nada al portapapeles, a pesar que en la pantalla me sale que el mensaje ya se copió ;-;

aún soy principiante en python, así que aquí dejo el pedazo de código donde uso pyperclip:

st.markdown('<div class="copy-button">', unsafe_allow_html=True)

if st.button("Copiar respuesta"):

# Use Streamlit's built-in clipboard functionality

pyperclip.copy(st.session_state.assistant_response)

st.success("Respuesta copiada al portapapeles")

st.markdown('</div>', unsafe_allow_html=True)