community icon indicating copy to clipboard operation
community copied to clipboard

Document xsel and xclip as dependencies on Linux

Open dessant opened this issue 9 years ago • 16 comments
trafficstars

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

dessant avatar Feb 26 '16 12:02 dessant

What's more, kivy_options doesn't have a "cutbuffer" section, so you can't override it with an environment variable.

janssen avatar Jul 07 '16 00:07 janssen

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.

stale[bot] avatar Oct 07 '17 07:10 stale[bot]

Well, this still happens in kivy 1.10, at least for me so it probably should be solved

`[INFO ] [OSC ] using for socket [INFO ] [Window ] Provider: sdl2(['window_egl_rpi'] ignored) [INFO ] [GL ] Using the "OpenGL" graphics system [INFO ] [GL ] Backend used [INFO ] [GL ] OpenGL version <b'4.5.0 NVIDIA 28.1.0'> [INFO ] [GL ] OpenGL vendor <b'NVIDIA Corporation'> [INFO ] [GL ] OpenGL renderer <b'NVIDIA Tegra X1 (nvgpu)/integrated'> [INFO ] [GL ] OpenGL parsed version: 4, 5 [INFO ] [GL ] Shading version <b'4.50 NVIDIA'> [INFO ] [GL ] Texture max size <16384> [INFO ] [GL ] Texture max units <32> [INFO ] [Window ] auto add sdl2 input provider [INFO ] [Window ] virtual keyboard not allowed, single mode, not docked [INFO ] [Clipboard ] Provider: gtk3(['clipboard_dbusklipper'] ignored) [CRITICAL] [Cutbuffer ] Unable to find any valuable Cutbuffer provider. xclip - FileNotFoundError: [Errno 2] No such file or directory: 'xclip' 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_xclip.py", line 17, in p = subprocess.Popen(['xclip', '-version'], stdout=subprocess.PIPE) File "/usr/lib/python3.5/subprocess.py", line 947, in init restore_signals, start_new_session) File "/usr/lib/python3.5/subprocess.py", line 1551, in _execute_child raise child_exception_type(errno_num, err_msg)

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 p = subprocess.Popen(['xsel'], stdout=subprocess.PIPE) File "/usr/lib/python3.5/subprocess.py", line 947, in init restore_signals, start_new_session) File "/usr/lib/python3.5/subprocess.py", line 1551, in _execute_child raise child_exception_type(errno_num, err_msg) `

benelgiac avatar Jan 19 '18 10:01 benelgiac

I am working on Kivy==1.10.1 and python==3.6. Same problem. Can it be solved???

vkrntgtm avatar Nov 22 '18 09:11 vkrntgtm

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.

GeorgeCiesinski avatar Nov 17 '19 03:11 GeorgeCiesinski

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 [INFO ] [GL ] OpenGL version <b'3.0 Mesa 19.0.8'> [INFO ] [GL ] OpenGL vendor <b'Intel Open Source Technology Center'> [INFO ] [GL ] OpenGL renderer <b'Mesa DRI Intel(R) Ivybridge Mobile '> [INFO ] [GL ] OpenGL parsed version: 3, 0 [INFO ] [GL ] Shading version <b'1.30'> [INFO ] [GL ] Texture max size <16384> [INFO ] [GL ] Texture max units <16> [INFO ] [Window ] auto add sdl2 input provider [INFO ] [Window ] virtual keyboard not allowed, single mode, not docked [INFO ] [Text ] Provider: sdl2 [DEBUG ] [Base ] Create provider from mouse [DEBUG ] [Base ] Create provider from probesysfs [DEBUG ] [ProbeSysfs ] using probesysfs! [DEBUG ] [ProbeSysfs ] found device: SynPS/2 Synaptics TouchPad at /dev/input/event8 [INFO ] [ProbeSysfs ] device match: /dev/input/event8 [INFO ] [MTD ] Read event from </dev/input/event8> [INFO ] [Base ] Start application main loop [INFO ] [GL ] NPOT texture support is available [INFO ] [MTD ] </dev/input/event8> range position X is 1268 - 5674 [INFO ] [MTD ] </dev/input/event8> range position Y is 1098 - 4754 [INFO ] [MTD ] </dev/input/event8> range touch major is 0 - 0 [INFO ] [MTD ] </dev/input/event8> range touch minor is 0 - 0 [INFO ] [MTD ] </dev/input/event8> range pressure is 0 - 255 [INFO ] [MTD ] </dev/input/event8> axes invertion: X is 0, Y is 0 [INFO ] [MTD ] </dev/input/event8> rotation set to 0 [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/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_xclip.py", line 17, in p = subprocess.Popen(['xclip', '-version'], stdout=subprocess.PIPE) File "/home/andi/.pyenv/versions/3.6.9/lib/python3.6/subprocess.py", line 729, in init restore_signals, start_new_session) File "/home/andi/.pyenv/versions/3.6.9/lib/python3.6/subprocess.py", line 1364, in _execute_child raise child_exception_type(errno_num, err_msg, err_filename)

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 p = subprocess.Popen(['xsel'], stdout=subprocess.PIPE) File "/home/andi/.pyenv/versions/3.6.9/lib/python3.6/subprocess.py", line 729, in init restore_signals, start_new_session) File "/home/andi/.pyenv/versions/3.6.9/lib/python3.6/subprocess.py", line 1364, in _execute_child raise child_exception_type(errno_num, err_msg, err_filename) `

AndiEcker avatar Jan 03 '20 16:01 AndiEcker

Same exact message for me as well

osm3000 avatar Apr 10 '20 22:04 osm3000

same thing. python 3.7 on kubuntu 19.10 also affects 2.0.0rc3

jgirardet avatar Jul 06 '20 06:07 jgirardet

[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 p = subprocess.Popen(['xclip', '-version'], stdout=subprocess.PIPE) File "/usr/lib/python3.7/subprocess.py", line 800, in init restore_signals, start_new_session) File "/usr/lib/python3.7/subprocess.py", line 1551, in _execute_child raise child_exception_type(errno_num, err_msg, err_filename)

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 p = subprocess.Popen(['xsel'], stdout=subprocess.PIPE) File "/usr/lib/python3.7/subprocess.py", line 800, in init restore_signals, start_new_session) File "/usr/lib/python3.7/subprocess.py", line 1551, in _execute_child raise child_exception_type(errno_num, err_msg, err_filename)

same for me

elijahlau avatar Aug 24 '20 12:08 elijahlau

fixed with apt -get install xclip https://github.com/jgirardet/mydevoirs/blob/4bfb9bbaf547e06ccffd524effa3eab02a50109c/.github/workflows/test_and_build.yml#L39

jgirardet avatar Aug 24 '20 13:08 jgirardet

sudo apt-get install -y xclip will fix it

EliDutu avatar Sep 16 '21 12:09 EliDutu

image Well this still happens on

Description: Ubuntu 22.04.1 LTS Release: 22.04 Codename: jammy

Shudh avatar Feb 28 '23 06:02 Shudh

This is still an issue.

If kivy depends on xsel and xclip, that installation should happen automatically when someone does pip install kivy

beauxq avatar Apr 15 '23 00:04 beauxq

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?

misl6 avatar Apr 15 '23 06:04 misl6

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.

beauxq avatar Apr 15 '23 13:04 beauxq

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.

wileur avatar Mar 18 '24 08:03 wileur