1
我在Linux機器上使用virtualenv。我沒有sudo
訪問權限,所以只能使用pip
。Python:在Linux上的virtualenv上安裝Tkinter
使用下面的命令:
pip install python-tk
但這導致錯誤
Collecting python-tk
Could not find a version that satisfies the requirement python-tk (from versions:)
No matching distribution found for python-tk
我需要安裝,因爲當我導入它導致錯誤 - 沒有模塊名爲tkinter – garg10may
在這種情況下,一個常見的解決方案是設置TCL_LIBRARY環境變量[這裏描述](https:// stackoverflow。 COM /問題/ 15884075/Tkinter的-IN-A-的virtualenv)。你在Ubuntu嗎?哪個版本?請將這些信息添加到您的問題中。 –
另外,如果你使用的是Python2.x,一定要'import tkiner' **不**'import tkinter' –