2017-04-20 4 views
0

Mit Pandas 0.19.2 auf Linux Mint 18Import: nicht name 'init_osx_clipboard'

importieren Wenn ich eine Tabelle von Libre Calc/MS Excel kopieren und ausführen

df = pd.read_clipboard() 

ich:

--------------------------------------------------------------------------- 
ImportError        Traceback (most recent call last) 
<ipython-input-7-6dead334eb54> in <module>() 
----> 1 df = pd.read_clipboard() 

/home/prashant/anaconda3/lib/python3.6/site-packages/pandas/io/clipboard.py in read_clipboard(**kwargs) 
    23    'reading from clipboard only supports utf-8 encoding') 
    24 
---> 25  from pandas.util.clipboard import clipboard_get 
    26  from pandas.io.parsers import read_table 
    27  text = clipboard_get() 

/home/prashant/anaconda3/lib/python3.6/site-packages/pandas/util/clipboard/__init__.py in <module>() 
    31 import os 
    32 import subprocess 
---> 33 from .clipboards import (init_osx_clipboard, 
    34       init_gtk_clipboard, init_qt_clipboard, 
    35       init_xclip_clipboard, init_xsel_clipboard, 

ImportError: cannot import name 'init_osx_clipboard' 

Wie löst man das? Vielen Dank im Voraus.

+0

Können Sie ein paar Beispiel Zeilen der Tabelle zur Verfügung stellen, die den Fehler beim Kopieren verursacht? –

Antwort

0

Die clipboard Dokumentation kann etwas Licht auf das Problem werfen, da Sie auf Linux laufen lassen:

On Linux, install xclip or xsel via package manager.
For example, in Debian: sudo apt-get install xclip
Otherwise on Linux, you will need the gtk or PyQt4 modules installed.
gtk and PyQt4 modules are not available for Python 3, and this module does not work with PyGObject yet.

+0

Danke. xclip ist bereits installiert, erhält aber immer noch dieselbe Nachricht. – user7893394

+0

Hmm, ich habe gerade Ubuntu 16.04 mit Libre Calc und 'xclip' (Python 3.6, Anaconda, Pandas 0.19.2) ausprobiert, und' read_clipboard() 'hat mit einer einfachen Tabelle funktioniert. Vielleicht ist etwas mit Ihrer Pandas-Installation beschädigt, haben Sie versucht, es zu entfernen und neu zu installieren? –

+0

Ja. Linux Mint 18 neu installiert, funktioniert aber immer noch nicht. – user7893394