[Tutor] pandas.to_clipboard() copies nothing

Jim jf_byrnes at comcast.net
Mon Jun 8 12:59:54 EDT 2020


On 6/7/20 9:38 AM, Jim wrote:
> On 6/7/20 4:07 AM, Peter Otten wrote:
>> Jim wrote:
>>
>>> You certainly know more about this than I do, but I wonder about the
>>> conclusion that xclip is not found.
>>
>> I don't know much, "qt tried as last resort" is my interpretation of the
>> latest pandas code, without actually running it.
> 
> 
> 
>>> I don't think I need QT any more so I am going to stop trying to figure
>>> this out and try to finish the script I was working on. I do plan on
>>> coming back and see if there is a different solution other than deleting
>>> PyQt5.
>>
>> Did you try invoking
>>
>> pandas.io.clipboard.set_clipboard("xclip")
>>
>> before pasting?
> 
> No unfortunately I did not. I wanted to get back to working on the 
> script that exposed this mess so when deleting the QT stuff worked I 
> just moved on. Once I get that script running I plan on re-installing QT 
> and see what happens.
> 

Ok, so I reloaded PyQt5, here's what happened:

(env36) jfb at jims-mint18 ~ $ pip install PyQt5
Collecting PyQt5
   Using cached 
PyQt5-5.15.0-5.15.0-cp35.cp36.cp37.cp38-abi3-manylinux2014_x86_64.whl 
(76.6 MB)
Collecting PyQt5-sip<13,>=12.8
   Using cached PyQt5_sip-12.8.0-cp36-cp36m-manylinux1_x86_64.whl (277 kB)
Installing collected packages: PyQt5-sip, PyQt5
Successfully installed PyQt5-5.15.0 PyQt5-sip-12.8.0

The results of running the test file:

(env36) jfb at jims-mint18 ~ $ python /home/jfb/Dev/Python/test_csv_file.py
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even 
though it was found.
This application failed to start because no Qt platform plugin could be 
initialized. Reinstalling the application may fix this problem.

Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, 
offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, 
wayland-xcomposite-glx, webgl, xcb.

Aborted

Here I tried adding set_clipboard:

(env36) jfb at jims-mint18 ~ $ python /home/jfb/Dev/Python/test_csv_file.py
Traceback (most recent call last):
   File "/home/jfb/Dev/Python/test_csv_file.py", line 11, in <module>
     pandas.io.clipboard.set_clipboard("xclip")
AttributeError: module 'pandas.io' has no attribute 'clipboard'
(env36) jfb at jims-mint18 ~ $


I googled the error and found references to it going back to 2013. Most 
solutions were aimed at people developing with PyQt, add debug 
statements etc. Some seemed  to aimed at users and suggested tinkering 
with simlinks, paths and installing additional packages. Most of them I 
did not fully understand.

Anyway I have my solution. Delete PyQt5 and the problem goes away. If I 
ever want to use QT again, setup a new VE and never run pandas in it.

Regards,  Jim



More information about the Tutor mailing list