简体   繁体   English

在 Mac 上安装 Tkinter 以在 Pycharm 上使用

[英]Installing Tkinter to use on Pycharm on a Mac

I just downloaded Pycharm because Spyder on Anaconda wasn't working anymore on my Mac.我刚刚下载了 Pycharm,因为 Anaconda 上的 Spyder 在我的 Mac 上不再工作。 I am trying use Tkinter and have tried to run code using both我正在尝试使用 Tkinter 并尝试使用两者运行代码

from tkinter import *

and

import tkinter as tk

The second is from my python class.第二个来自我的 python class。 Both times it returns两次都返回

ImportError: No module named tkinter

I have tried to search for "tkinter" on Python Interpreter but there's no solid "tkinter."我试图在 Python Interpreter 上搜索“tkinter”,但没有可靠的“tkinter”。 Only others like tkinter.math.只有其他人喜欢 tkinter.math。 Please help.请帮忙。

Tkinter would not be visible on Python Interpreter since it is a part of standard Python installation, the only additional modules or packages which user downloads are visible in Settings. Tkinter 在 Python 解释器上不可见,因为它是标准 Python 安装的一部分,用户下载的唯一附加模块或包在设置中可见。 Since, Spyder on your PC is not working as well, make sure python is installed properly and is configured correctly with path details properly set up.由于您 PC 上的 Spyder 无法正常工作,请确保 python 已正确安装并正确配置并正确设置了路径详细信息。

I think you should check the interpreter of PyCharm.我认为您应该检查 PyCharm 的解释器。 Or Reinstall the python package and make a virtual environment.或者重新安装python package,做一个虚拟环境。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM