Skip to content

to_clipboard has no effect in ipython (works in python) (linux) #22707

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
seanv507 opened this issue Sep 14, 2018 · 11 comments
Closed

to_clipboard has no effect in ipython (works in python) (linux) #22707

seanv507 opened this issue Sep 14, 2018 · 11 comments
Labels
Output-Formatting __repr__ of pandas objects, to_string

Comments

@seanv507
Copy link

Code Sample, a copy-pastable example if possible

# Your code here
import pandas as pd
a=pd.DataFrame([0,1,23])
a.to_clipboard()

Problem description

Hi
since several months I am no longer able to use the to_clipboard function in ipython - nothing pasted to clipboard. I notice it works in python!!. I have tried using latest version of ipython/pandas on anaconda but no improvement

Expected Output

I expect to paste dataframe into text file etc.

Output of pd.show_versions()

INSTALLED VERSIONS

commit: None
python: 3.6.3.final.0
python-bits: 64
OS: Linux
OS-release: 4.15.0-34-generic
machine: x86_64
processor: x86_64
byteorder: little
LC_ALL: None
LANG: en_GB.UTF-8
LOCALE: en_GB.UTF-8

pandas: 0.23.4
pytest: 3.7.2
pip: 9.0.3
setuptools: 40.2.0
Cython: 0.26.1
numpy: 1.13.3
scipy: 1.0.0
pyarrow: 0.7.1
xarray: None
IPython: 6.5.0
sphinx: 1.6.3
patsy: 0.4.1
dateutil: 2.7.3
pytz: 2014.10
blosc: None
bottleneck: 1.2.1
tables: 3.4.2
numexpr: 2.6.2
feather: None
matplotlib: 2.1.0
openpyxl: 2.4.8
xlrd: 1.1.0
xlwt: 1.3.0
xlsxwriter: 1.0.2
lxml: 4.1.0
bs4: 4.4.1
html5lib: 0.9999999
sqlalchemy: 1.0.14
pymysql: None
psycopg2: 2.7.1 (dt dec pq3 ext lo64)
jinja2: 2.7.3
s3fs: None
fastparquet: None
pandas_gbq: None
pandas_datareader: None

@TomAugspurger
Copy link
Contributor

http://pandas-docs.github.io/pandas-docs-travis/io.html#clipboard

Note

You may need to install xclip or xsel (with gtk, PyQt5, PyQt4 or qtpy) on Linux to use these methods.

Do you have those installed/

@seanv507
Copy link
Author

well I installed xsel, and it still didn't work. [and note it works in normal python just not ipython?]. (and it used to work on my linux machine??)

@TomAugspurger
Copy link
Contributor

TomAugspurger commented Sep 14, 2018 via email

@seanv507
Copy link
Author

thanks - yes it is just root anaconda folder

@TomAugspurger
Copy link
Contributor

Any luck debugging this @seanv507?

@seanv507
Copy link
Author

seanv507 commented Sep 18, 2018 via email

@mroeschke mroeschke added the Needs Info Clarification about behavior needed to assess issue label Jan 13, 2019
@moinluk
Copy link

moinluk commented Jan 24, 2019

The to_clipboard function is still not working properly with ipython or jupyter, but it works with python.
The example code above results in following error:

QXcbClipboard::setMimeData: Cannot set X11 selection owner

It seems that in my case the qt_clipboard was used.
Is there a possibility to switch to a another clipboard e.g. xclip or xsel (pyperclip works fine)?

Output of pd.show_versions()

INSTALLED VERSIONS

commit: None
python: 3.7.0.final.0
python-bits: 64
OS: Linux
OS-release: 4.15.0-43-generic
machine: x86_64
processor: x86_64
byteorder: little
LC_ALL: None
LANG: de_DE.UTF-8
LOCALE: de_DE.UTF-8

pandas: 0.23.4
pytest: 3.8.0
pip: 18.1
setuptools: 40.2.0
Cython: 0.28.5
numpy: 1.15.1
scipy: 1.1.0
pyarrow: None
xarray: None
IPython: 6.5.0
sphinx: 1.8.2
patsy: 0.5.0
dateutil: 2.7.3
pytz: 2018.5
blosc: None
bottleneck: 1.2.1
tables: 3.4.4
numexpr: 2.6.8
feather: None
matplotlib: 2.2.3
openpyxl: 2.5.6
xlrd: 1.1.0
xlwt: 1.3.0
xlsxwriter: 1.1.0
lxml: 4.2.5
bs4: 4.6.3
html5lib: 1.0.1
sqlalchemy: 1.2.11
pymysql: None
psycopg2: None
jinja2: 2.10
s3fs: None
fastparquet: None
pandas_gbq: None
pandas_datareader: None

@krey krey mentioned this issue Sep 16, 2019
5 tasks
@jreback jreback added this to the 1.0 milestone Nov 6, 2019
@jreback jreback added Output-Formatting __repr__ of pandas objects, to_string and removed Needs Info Clarification about behavior needed to assess issue labels Nov 6, 2019
@TomAugspurger
Copy link
Contributor

It's possible that the recenlty updated pyperclip we vendor has fixed some issues.

Is there a possibility to switch to a another clipboard e.g. xclip or xsel (pyperclip works fine)?

Not really, aside from manually setting pandas.io.clipboard.copy and pandas.io.clipboard.paste.

Going to close this since this is isn't easily reproducible so it's not clear what needs to be done.

@TomAugspurger TomAugspurger modified the milestones: 1.0, No action Dec 30, 2019
@moinluk
Copy link

moinluk commented Dec 30, 2019

It seems be fixed in pd.version = '0.26.0.dev0+1487.g733eb77f7' Thanks.

@filiphl
Copy link

filiphl commented Nov 19, 2020

Installing xclip fixed this for me.

@mattmoehr
Copy link

Same for me. Needed to sudo apt install xclip.

Ubuntu 20.04
pandas 1.2.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Output-Formatting __repr__ of pandas objects, to_string
Projects
None yet
Development

No branches or pull requests

7 participants