I am having a problem during the installation of tkinter. I have version 2.7.11. I entered the pip install tkinter
on dos but it shows the following message:
collecting tkinter
Could not find a version that satisfies the requirement tkinter (from versions:) No matching distribution found for tkinter
I have successfully installed flask with the same procedure, but for tkinter it is showing problem. How can I get rid of this problem?
The Python "ModuleNotFoundError: No module named 'tkinter'" occurs when tkinter is not installed in our Python environment. To solve the error, install the module and import is as import tkinter as tk .
The easiest way to fix this problem is by upgrading your python to use python 3. If upgrading python is not an option, you only need to rename your imports to use Tkinter (uppercase) instead of tkinter (lowercase). Output: As a result, this window proves that your python installation includes the Tkinter module.
Tkinter comes pre-installed with the Python installer binaries for Mac OS X and the Windows platform. So if you install Python from the official binaries for Mac OS X or Windows platform, you are good to go with Tkinter. For Debian versions of Linux you have to install it manually by using the following commands.
Tkinter can be installed using pip. The following command is run in the command prompt to install Tkinter. This command will start downloading and installing packages related to the Tkinter library.
You should install
apt-get install python-tk
This should solve your issue
The Tkinter library comes in default with every Python installation
Try this:
import Tkinter as tk
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With