community
community copied to clipboard
Document xsel and xclip as dependencies on Linux
I could not find a reference about them in the docs.
Is a cut buffer provider critical? Couldn't we just skip the feature when these deps are not present?
https://github.com/kivy/kivy/blob/54444952ba0422c183eb8c711b82c46658be6070/kivy/core/clipboard/init.py#L146
What's more, kivy_options doesn't have a "cutbuffer" section, so you can't override it with an environment variable.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Well, this still happens in kivy 1.10, at least for me so it probably should be solved
`[INFO ] [OSC ] using
xsel - FileNotFoundError: [Errno 2] No such file or directory: 'xsel'
File "/usr/lib/python3/dist-packages/kivy/core/init.py", line 59, in core_select_lib
fromlist=[modulename], level=0)
File "/usr/lib/python3/dist-packages/kivy/core/clipboard/clipboard_xsel.py", line 16, in
I am working on Kivy==1.10.1 and python==3.6. Same problem. Can it be solved???
Kivy==1.11.1, Python 3.7, and I am also experiencing this issue. Odd, doesn't seem to affect my app, but it is concerning to see these errors.
Same here on a fresh Ubuntu without the xsel/xclip apt-get packages. Didn't find any SDL package in the Ubuntu repos that mentions SDL clipboard support.
Kivy App Log (removed some irrelevant DEBUG message):
`[INFO ] [Kivy ] v1.11.1
[INFO ] [Kivy ] Installed at "/home/andi/.pyenv/versions/kivy_env/lib/python3.6/site-packages/kivy/init.py"
[INFO ] [Python ] v3.6.9 (default, Aug 28 2019, 15:54:20)
[GCC 7.4.0]
[INFO ] [Python ] Interpreter at "/home/andi/.pyenv/versions/kivy_env/bin/python"
[INFO ] [Factory ] 184 symbols loaded
[INFO ] [Image ] Providers: img_tex, img_dds, img_sdl2, img_gif (img_pil, img_ffpyplayer ignored)
[DEBUG ] [Window ] Ignored <egl_rpi> (import error)
[INFO ] [Window ] Provider: sdl2(['window_egl_rpi'] ignored)
[INFO ] [GL ] Using the "OpenGL" graphics system
[INFO ] [GL ] Backend used
xsel - FileNotFoundError: [Errno 2] No such file or directory: 'xsel': 'xsel'
File "/home/andi/.pyenv/versions/kivy_env/lib/python3.6/site-packages/kivy/core/init.py", line 63, in core_select_lib
fromlist=[modulename], level=0)
File "/home/andi/.pyenv/versions/kivy_env/lib/python3.6/site-packages/kivy/core/clipboard/clipboard_xsel.py", line 16, in
Same exact message for me as well
same thing. python 3.7 on kubuntu 19.10 also affects 2.0.0rc3
[INFO ] [Clipboard ] Provider: sdl2(['clipboard_xclip', 'clipboard_xsel', 'clipboard_dbusklipper', 'clipboard_gtk3'] ignored)
[CRITICAL] [Cutbuffer ] Unable to find any valuable Cutbuffer provider. Please enable debug logging (e.g. add -d if running from the command line, or change the log level in the config) and re-run your app to identify potential causes
xclip - FileNotFoundError: [Errno 2] No such file or directory: 'xclip': 'xclip'
File "/home/eli/Desktop/guess/venv/lib/python3.7/site-packages/kivy/core/init.py", line 63, in core_select_lib
fromlist=[modulename], level=0)
File "/home/eli/Desktop/guess/venv/lib/python3.7/site-packages/kivy/core/clipboard/clipboard_xclip.py", line 17, in
xsel - FileNotFoundError: [Errno 2] No such file or directory: 'xsel': 'xsel'
File "/home/eli/Desktop/guess/venv/lib/python3.7/site-packages/kivy/core/init.py", line 63, in core_select_lib
fromlist=[modulename], level=0)
File "/home/eli/Desktop/guess/venv/lib/python3.7/site-packages/kivy/core/clipboard/clipboard_xsel.py", line 16, in
same for me
fixed with apt -get install xclip https://github.com/jgirardet/mydevoirs/blob/4bfb9bbaf547e06ccffd524effa3eab02a50109c/.github/workflows/test_and_build.yml#L39
sudo apt-get install -y xclip will fix it
Well this still happens on
Description: Ubuntu 22.04.1 LTS Release: 22.04 Codename: jammy
This is still an issue.
If kivy depends on xsel and xclip, that installation should happen automatically when someone does pip install kivy
Hi @beauxq !
Cutbuffer is not essential, neither are xclip or xsel:
https://github.com/kivy/kivy/blob/cd4cb0f649c1d34503aba631e405f0c532aef48a/kivy/core/clipboard/init.py#L156-L157
Can you confirm that even if the critical error (which I agree is not great) is shown, the app works just fine?
Yes, I see now. I had an app crash and I saw the xsel and xclip messages, and I thought they were related to the crash. I see now that those messages are not related to the crash that I had.
Workaround for pure wayland installations where xsel and xclip are not available at all, like Yocto/Poky on imx8mm:
# Create fake xsel to make Kivy error message go away
# Run as root, and make sure you don't already have xsel installed, as it will be overwritten
echo "#!/bin/bash" > /usr/bin/xsel
chmod +x /usr/bin/xsel
This creates an empty, executable script that gets rid of the error message. It doesn't solve the copy/paste Cutbuffer issue. But my embedded device has no need for cut and paste.
The point is that Kivy is looking for anything executable named xsel, and will be very happy as long as it is in the path.
For simplicity in Yocto I put this script in the /etc/rc.local but it is enough to create it once.