首先,从您要使用它的目录运行pip freeze
。如果您使用虚拟环境,请确保它处于活动状态。这将显示您当前安装
更精确的方法是检查它们会安装在站点包所有包(我用IPython中):
How do I find the location of my Python site-packages directory?
$ ipython
In [1]: import site
In [2]: site.getsitepackages()
Out[2]:
['/usr/local/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages',
'/Library/Python/3.6/site-packages']
然后去那里:
cchilders:/usr/local/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages
$ ls
IPython jupyter_client python_dateutil-2.6.0.dist-info
Jinja2-2.9.6.dist-info jupyter_client-5.0.1.dist-info pytz
MarkupSafe-1.0.dist-info jupyter_console pytz-2017.2.dist-info
Pygments-2.2.0.dist-info jupyter_console-5.1.0.dist-info pyzmq-16.0.2.dist-info
__pycache__ jupyter_core qtconsole
appnope jupyter_core-4.3.0.dist-info qtconsole-4.3.0.dist-info
...etc...
您在pip freeze
上看到的相同内容应显示在此处。
确保你有正确版本的python包。如果使用python 3,你不得不说:
pip3 freeze
但显然是为了安装使用apt
如果你有Linux的最安全的办法:
sudo apt-get install python-tk
Install tkinter for Python
你使用Windows,因为Tkinter只针对Windows的python文件标准。如果使用linux,那么'apt install python-tk'会安装它。 – SolarFactories