如何在Mac上安装Tkinter

时间:2017-08-22 22:27:50

标签: python tkinter

Using /Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg
Processing dependencies for pip
Finished processing dependencies for pip
Admins-MacBook-Pro:Desktop admin$ 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
Admins-MacBook-Pro:Desktop admin$ 
Admins-MacBook-Pro:Desktop admin$ python
Python 2.7.10 (default, Oct 23 2015, 19:19:21) 
[GCC 4.2.1 Compatible Apple LLVM 7.0.0 (clang-700.0.59.5)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> exit()
Admins-MacBook-Pro:Desktop admin$ sudo apt-get install python3-tk #python3
Password:
sudo: apt-get: command not found
Admins-MacBook-Pro:Desktop admin$ import Tkinter as tk
-bash: import: command not found
Admins-MacBook-Pro:Desktop admin$ from Tkinter import *
from: can't read /var/mail/Tkinter
Admins-MacBook-Pro:Desktop admin$ 
Admins-MacBook-Pro:Desktop admin$ 

1 个答案:

答案 0 :(得分:-3)

您不需要通过pip安装它,您可以在shell或脚本上将其作为import Tkinter导入。