no module named 'Tkinter' on windows - python

i'm using windows pc. It appears Tkinter doesn't come with the installation.
python --version
Python 3.7.6
So i've tried to install it with pip.
pip install tk
Collecting tk
Using cached tk-0.1.0-py3-none-any.whl (3.9 kB)
Installing collected packages: tk
Successfully installed tk-0.1.0
When i try to import;
import Tkinter
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'Tkinter'
or
import tkinter
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'tkinter'

You need to check the option tcl/tk and IDLE when installing Python on Windows. Retroactive installation through pip doesn't work.

Related

Getting error while importing win32com module

I installed the pywin32 module in my system. But when I import the "win32com" module getting the error as shown below.
Error:-
Traceback (most recent call last):
File "C:\Users\Lenovo\Desktop\script.py", line 1, in <module>
import win32com.client
ModuleNotFoundError: No module named 'win32com'
any idea on this
Try install: pip install pypiwin32

Python Interpreter: ModuleNotFoundError: No module named '_tkinter'

When I run import tkinter I get this error:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.9/tkinter/__init__.py", line 37, in <module>
import _tkinter # If this fails your Python may not be configured for Tk
ModuleNotFoundError: No module named '_tkinter'
Ruuning apt-get install python3-tk doesn't sove this issue.
Running Python 3.9 on Debian Experimental
Maybe you can try import tkinter instead of import _tkinter

Can't install pyperclip python3 Mac?

I'm trying to run pyperclip module in PyCharm on Mac OS X. I've imported it and got a traceback error. I tried reinstalling it in terminal and it displayed collecting packages but I still get the error:
Traceback (most recent call last):
File "/Users/User/PycharmProjects/numberEmailRetractor/main.py", line 4, in <module>
import pyperclip, re
ImportError: No module named pyperclip

Error Installing Idle3.6

I am running Linux Mint 18.1 and python 3.6.
I would like to install idle3.6 but after installing this package
i get the following error :
Traceback (most recent call last):
File "/usr/local/lib/python3.6/idlelib/pyshell.py", line 4, in
<module>
from tkinter import *
File "/usr/local/lib/python3.6/tkinter/__init__.py", line 36, in
<module>
import _tkinter # If this fails your Python may not be configured for
Tk
ModuleNotFoundError: No module named '_tkinter'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/bin/idle3.6", line 3, in <module>
from idlelib.pyshell import main
File "/usr/local/lib/python3.6/idlelib/pyshell.py", line 7, in
<module>
"Your Python may not be configured for Tk. **", file=sys.__stderr__)
NameError: name 'sys' is not defined
what i understand is that i need to install the tkinter package.
what i have tried so far is this command:
sudo apt-get install python3-tk
but it i still get the above error.
which command should i use to install tkinter for python 3.6?
Here is a Linux Mint IDLE version: https://community.linuxmint.com/software/view/idle-python3.5, since you are using Linux Mint. There's not yet a idle-python3.6 version.

python setuptools: "No module named version"

I'm trying to install a package using python setup.py build, but it fails when it cannot find setuptools.version. In fact:
import setuptools
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/gpajer/anaconda/lib/python2.7/site- packages/setuptools/__init__.py", line 11, in <module>
import setuptools.version
ImportError: No module named version
Shouldn't there be a file .../anaconda/lib/python2.7/site-packages/setuptools/version.py? There is no such file. Any ideas?
From https://anaconda.org/anaconda/setuptools:
To install this package with conda run:
conda install -c anaconda setuptools=21.2.1

Categories