Next, make sure you link the correct versions of Tcl/Tk when installing Python. Step 2: Linking the Correct Tcl/Tk Versions On macOS, you can use Homebrew: brew install tcl-tk Step 1: Installing Necessary System Packagesįirst, let's make sure we have installed the necessary system packages for tkinter. The following two steps should help you fix the tkinter and pyenv issue. Using tkinter with pyenv can be tricky due to missing dependencies. I'm using Mac OS and use Visual Studio Code. If you install Tcl/Tk in the default locations, simply rerunning "make" should build the _tkinter extension. You may have to install Tcl and Tk (when using RPM, install the -devel RPMs as well) and/or edit the setup.py script to point to the right locations where Tcl/Tk is installed. Do not edit Modules/Setup (it is out of date). If it fails with "No module named _tkinter", your Python configuration needs to be modified to include this module (which is an extension module implemented in C). I don't really understand these steps that I found: I have tkinter folder in my python3.7 folder. I read about some problem with directory in setup.py but I don't understand how to fix it. I tried to find a solution online but I couldn't figure it out (mostly didn't understand it). ModuleNotFoundError: No module named '_tkinter' Import _tkinter # If this fails your Python may not be configured for Tk When I try to import Tkinter it throws this message: > import tkinterįile "/Library/Developer/CommandLineTools/Library/Frameworks/amework/Versions/3.7/lib/python3.7/tkinter/_init_.py", line 36, in I'm trying to make Python GUI for my school project so I decided to use Tkinter.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |