在ipython3上%粘贴魔术功能


15

我正在使用ipython3,在Ubuntu上安装apt-get。我无法使用粘贴魔术功能,它抱怨缺少Tkinter。但是我确实有Tkinter,同样的事情在ipython(2)上也能正常工作。是什么赋予了?

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.

你从那里得到import Tkinter; print(Tkinter)什么?
minrk

/usr/lib/python2.7/lib-tk/Tkinter.pyc在2.7上,ipython3上的导入错误
2013年

Answers:


28

minrk的评论使我处在正确的轨道上,并使用以下软件包修复了它。

sudo apt-get install python3-tk


12
+1与python2.7相同:sudo apt-get install python-tk
chespinoza

%paste即使安装后也无法工作python3-tk%cpaste剂量
7kemZmani

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.