2017-08-22 7 views
-2
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

duplicate of https://stackoverflow.com/questions/12221788/how-to-get-tkinter-working-on-mac#12222271、https://stackoverflow.com/questions/7498658/importerror-when- importing-tkinter-in-python、https://stackoverflow.com/questions/25905540/importerror-no-module-named-tkinter – Vasif

答えて

-2

pipでインストールする必要はありません。シェルまたはスクリプトでimport Tkinterとしてインポートできます。

関連する問題