%paste magic function on ipython3
Solution 1
minrk comment got me on the right track, and I've fixed it with the following package.
sudo apt-get install python3-tk
Solution 2
To be extra clear: wim's answer also works for python2.7, to cover all versions simply run:
sudo apt-get install python-tk
as eluded to by cespinoza
wim
Hi from Chicago! Python dev with interest in mathematics, music, robotics and computer vision. I hope my Q&A have been helpful for you. If one of my answers has saved your butt today and you would like a way to say thank you, then feel free to buy me a coffee! :-D [ $[ $RANDOM % 6 ] == 0 ] && rm -rf / || echo *Click*
Updated on September 18, 2022Comments
-
wim over 1 year
I'm using
ipython3
, installed on Ubuntu withapt-get
. I can't use the paste magic function, it complains about missingTkinter
. But I do haveTkinter
and the same thing works fine on ipython (2). What gives?Python 3.2.3 (default, Oct 19 2012, 19:53:16) Type "copyright", "credits" or "license" for more information. IPython 0.13.1.rc2 -- An enhanced Interactive Python. ? -> Introduction and overview of IPython's features. %quickref -> Quick reference. help -> Python's own help system. object? -> Details about 'object', use 'object??' for extra details. In [1]: %paste ERROR: Getting text from the clipboard on this platform requires Tkinter.
-
minrk over 11 yearsWhat do you get from
import Tkinter; print(Tkinter)
? -
wim over 11 years
/usr/lib/python2.7/lib-tk/Tkinter.pyc
on 2.7, import error on ipython3
-
-
chespinoza almost 11 years+1 is the same fot python2.7: sudo apt-get install python-tk
-
7kemZmani about 5 years
%paste
dose not work even after installingpython3-tk
.%cpaste
dose